Category: Laravel, PHP

The CLI( Command Line Interface) is one of the best places to execute a long long-running task and Laravel has provided us with the Artisan Console that allows us to create our custom commands. I usually set up custom artisan commands whenever I am building something that requires initial setup or when I want to run queries on a large DB. In this tutorial, I am going to show you how to set up a custom Artisan command and how to calculate the execution time of that command. There are two ways to create a custom Artisan Console command, the Class-Based Command and the Closure Based Command.

To calculate the execution time of a custom command we can leverage the Laravel now()helper method.
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