Category: Laravel, Laravel, Laravel, api, api, api

When you developing an API using laravel It is easier to debug api requests if you have a way to see api request and response parameters. We can simply do that using a middleware. You can create new middleware using artisan command

In terminate function i have recorded the end time and logged request data using the log function.

To run the middleware you should register your middleware on app/Http/Kernel.php file.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners