When a controller does not exist, a _ReflectionException_ is fired.
Somewhere in the rendering process for this exception the corresponding HTTP response gets output twice.
This is especially bad if the error response contains JSON as this results as the JSON string "doubled", which results in invalid syntax.
Route::get('/test', 'TestController@index');php artisan serve.localhost:8000/test and take a look at the rendered exceptions (should be only one, it gets rendered twice).$response->send(); or $kernel->terminate($request, $response);Probably because the exception occurred again when the view was rendered.
I got the same thing here. Also found an open thread with the same behavior in https://laracasts.com/discuss/channels/laravel/exception-handler-fired-multiple-times .
Does anyone know the solution?
Probably because the exception occurred again when the view was rendered.
Why the downvotes? That's basically exactly the problem in most cases, and the most common case affecting controller middlewares has been fixed in laravel 5.4.