app/Http/Requests/User/StoreUserRequest.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 [
            'first_name' => ['required'],
            'last_name' => ['required'],
            'username' => [
                'required',
                'max:25',
                Rule::unique('users', 'username'),
            ],
            'email' => [
                'required',
                'email', Rule::unique('users'),
            ],
            'password' => PasswordRules::register($this->email),
            'roles' => ['required', 'array'],
        ];
    }
public function rules ( ) { return [ 'first_name' => [ 'required' ] , 'last_name' => [ 'required' ] , 'username' => [ 'required' , 'max:25' , Rule :: unique ( 'users' , 'username' ) , ] , 'email' => [ 'required' , 'email' , Rule :: unique ( 'users' ) , ] , 'password' => PasswordRules :: register ( $ this -> email ) , 'roles' => [ 'required' , 'array' ] , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .