app/Http/Requests/User/UpdateProfileRequest.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()
    {
        $user = \Auth::id();
        return [
            'first_name' => ['required'],
            'last_name' => ['required'],
            'username' => ['sometimes', 'required', 'string', 'max:25', Rule::unique('users')->ignore($user)],
            'email' => ['sometimes', 'required', 'email', Rule::unique('users')->ignore($user)],
            'avatar_type' => ['required', Rule::in(array_merge(['gravatar', 'storage'], (new SocialiteHelper)->getAcceptedProviders()))],
            'avatar_location' => ['sometimes', 'image'],
        ];
    }
public function rules ( ) { $ user = \ Auth :: id ( ) ; return [ 'first_name' => [ 'required' ] , 'last_name' => [ 'required' ] , 'username' => [ 'sometimes' , 'required' , 'string' , 'max:25' , Rule :: unique ( 'users' ) -> ignore ( $ user ) ] , 'email' => [ 'sometimes' , 'required' , 'email' , Rule :: unique ( 'users' ) -> ignore ( $ user ) ] , 'avatar_type' => [ 'required' , Rule :: in ( array_merge ( [ 'gravatar' , 'storage' ] , ( new SocialiteHelper ) -> getAcceptedProviders ( ) ) ) ] , 'avatar_location' => [ 'sometimes' , 'image' ] , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .