Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.
Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php
and app/Http/Middleware/Authenticate.php
Tip: Via your .env
file you can handle the visibility of the HTTP Exception responses. APP_DEBUG=false
(for display json exception responses in production)
Hi, thanks for the work provided.
Working on Lumen 6, needed to change :
use Illuminate\Http\Exception\HttpResponseException;
to :
use Illuminate\Http\Exceptions\HttpResponseException;
Notify the 's' change in Exception, might be for norm.