I\'m using FormRequest to validate from which is sent in an API call from my smartphone app. So, I want FormRequest alway return json when validation fail.
I saw th
It boggles my mind why this is so hard to do in Laravel. In the end, based on your idea to override the Request class, I came up with this.
app/Http/Requests/ApiRequest.php
Then, in every controller just pass \App\Http\Requests\ApiRequest
\App\Http\Requests\ApiRequest
public function index(ApiRequest $request)