murilo

Laravel Many Custom Requests

Posted 1 month ago by murilo

Hello Guys , I usaly make custom laravel request like this -

THIS way it works 

public function rules()
    {
        return [
            'email'                => ['required'  , new VerifyIfThisEmailDoesNotExist()] ,
            'name'              => 'required'
        ];
    }

But I am trying to use many custom classes in just one field , and it is not working . like this -

THIS way dont works 

public function rules()
    {
        return [
            'email'                => ['required'  , new VerifyIfThisEmailDoesNotExist() , new VerifyIfThisEmailisGmailAccount( ) , ] ,
            'name'              => 'required'
        ];
    }

It is only possible to use one custome class for fields ?

Please sign in or create an account to participate in this conversation.