app/Http/Requests/Api/Admin/User/UpdateRequest.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
#[ArrayShape(['name' => "array", 'email' => "array"])]
    public function rules(): array
    {
        return [
            'name' => ['required_unless:action,removeRole', 'string', 'max:255'],
            'email' => ['required_unless:action,removeRole', 'string', 'email', 'max:255', Rule::unique('users', 'email')->ignore($this->id)],
            'user' => ['required_if:action,removeRole'],
            'action' => ['in:removeRole']
        ];
    }
#[ ArrayShape ( [ 'name' => " array " , 'email' => " array " ] ) ] public function rules ( ) : array { return [ 'name' => [ 'required_unless:action,removeRole' , 'string' , 'max:255' ] , 'email' => [ 'required_unless:action,removeRole' , 'string' , 'email' , 'max:255' , Rule :: unique ( 'users' , 'email' ) -> ignore ( $ this -> id ) ] , 'user' => [ 'required_if:action,removeRole' ] , 'action' => [ 'in:removeRole' ] ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .