Hi, I'm building an API where methods in Controller are called by cURL.
Well, the methods are create and view, and I'm trying to validate some fields, like Authentication by token.
Whenever I call the methos, it's redirect to homepage, not validating any field, even if I set the rule with 'required' and pass a null value for the field.
It's possible to validate a cURL request with form validating?
Thanks, the authenticate method is ok, my problem is with the other fields, like an id.
Well, I see in the documentation, the Form Request redirects to the previous page and throw the error.
What I'm trying is to stop in controller and throw the error, and I think it's not possible, right?
@CleytonBonamigo If you specify with your request that you accept a json response the form request will not redirect back but return a json array of errors. It uses $request->wantsJson() internally.