murilo
124
3
Laravel

Form Request Validates an Array

Posted 1 year ago by murilo

Hello Guys , does any one there knows how can I validate and array with form Request ?

I want to make something like that -

   public function rules()
    {
        return [
            'user[id]'               => 'required' ,
            'user[status]'   => 'required' 
        ];
    }

I tried like this as well -

   public function rules()
    {
        return [
            'user.id'               => 'required' ,
            'user.status'       => 'required' 
        ];
    }

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

Reply to

Use Markdown with GitHub-flavored code blocks.