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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners