There is a task to globally control what the application will return (laravel5 / lumen). Using the controller as an example, it could be something like this:
echo '...'; return '...'; return view(); return response('...'); ... It is necessary in some global x-place to put something like:
if (!$response instedOf Response) { ... } To be able to return only one Response object (custom wrapper over the box).
Previously, there were global posts in laravel that you could subscribe to, but I did not find anything similar for version 5.