app/Http/Requests/UserStoreRequest.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', 'string', 'max:50', new LatinName()],
            'last_name' => ['required', 'string', 'max:50', new LatinName()],
            'birthday' => ['required', 'date', new Under18()],
            'joined_date' => [
                'required', 'date', 'after:birthday',
                new JoinedDateOnWeekend()
            ],
            'role_id' => ['required', 'integer', Rule::in([1, 2])],
            'gender' => ['required', 'string', Rule::in(['Female', "Male"])],
        ];
    }
public function rules ( ) { return [ 'first_name' => [ 'required' , 'string' , 'max:50' , new LatinName ( ) ] , 'last_name' => [ 'required' , 'string' , 'max:50' , new LatinName ( ) ] , 'birthday' => [ 'required' , 'date' , new Under18 ( ) ] , 'joined_date' => [ 'required' , 'date' , 'after:birthday' , new JoinedDateOnWeekend ( ) ] , 'role_id' => [ 'required' , 'integer' , Rule :: in ( [ 1 , 2 ] ) ] , 'gender' => [ 'required' , 'string' , Rule :: in ( [ 'Female' , " Male " ] ) ] , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .