app/Http/Requests/CreateUserRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        return [
            'username'              => 'required|unique:users,username|min:3|max:50',
            'first_name'            => 'required|min:2|max:255',
            'last_name'             => 'required|min:2|max:255',
            'email'                 => 'required|email|unique:users,email',
            'password'              => 'required|min:6|same:password_confirmation',
            'password_confirmation' => 'required|min:6|same:password',
            'role_id'               => 'required'
        ];
    }
public function rules ( ) { return [ 'username' => 'required|unique:users,username|min:3|max:50' , 'first_name' => 'required|min:2|max:255' , 'last_name' => 'required|min:2|max:255' , 'email' => 'required|email|unique:users,email' , 'password' => 'required|min:6|same:password_confirmation' , 'password_confirmation' => 'required|min:6|same:password' , 'role_id' => 'required' ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .
// https://laravel.com/docs/5.2/validation#available-validation-rules