2

UserFormRequest.php

<?php

namespace App\Http\Requests;
use App\Http\Requests\Request;



class UserForm extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
       return true;

    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'firstname' => 'required|max:50|alpha',

            'per_address' => 'required',//permanent address
            'temp_address' => 'required',//temporary address
            'occupation' => 'required',
            'gender' => 'required',
            'email' => 'required|email|min:6|max:200|unique:users',            
            'phone' => 'required|numeric|digits_between:8,25',           
            'bloodgroup' => 'required',           
            'date' => 'required',


        ];
    }
}
Anto S
  • 2,448
  • 6
  • 32
  • 50
Sam
  • 73
  • 1
  • 5

1 Answers1

4

Try functions ucwords and ucfirst, keep in mind you need to transform to lowercase the text first using

ucwords(strtolower($text))

Note: mb_strtolower for multi-byte encodings such as UTF8.

http://php.net/manual/en/function.ucwords.php

http://php.net/manual/en/function.ucfirst.php

http://php.net/manual/en/function.strtolower.php

http://php.net/manual/en/function.mb-strtolower.php

Mathew B.
  • 199
  • 8