I use Form Requests to incapsulate validation logic into files then to use it like:
public function register(RegisterRequest $request) {}
When validation is false it redirects to the index page.
How to return json with http code instead redirection?
2
Answers
From postman, you have to pass
Accept
asapplication/json
on header tabuse following code :
for example :