Is there a request/validation rule that would throw an error in case of unexpected input?

  input, laravel, request

Something like Request::only() that throws an error if there is any extra/unexpected field in the request?

E.g.:

$request->strictly(['username', 'password']);

that would throw an error if POST request contains fields ‘username’, ‘password’, and ‘foo’?

In case there isn’t, what would be the best way to perfoem such a verification manually?

Source: Laravel

Leave a Reply