Laravel theorytheory 0/50 · 0%
Fundamentals · hard

47. Custom Artisan Commands

Extending the CLI for domain tasks.

Custom commands (php artisan make:command SyncBlockchainBalances) define a $signature for arguments/options and a handle() method containing the logic, registered automatically via Laravel's command discovery. They're ideal for recurring operational tasks like reconciling on-chain balances, running data backfills, or wrapping cron jobs invoked from the scheduler. Commands can report progress with $this->withProgressBar() and output structured results with $this->table().

Check your understanding

  1. 1. Which property defines a command's name and expected arguments?

  2. 2. Which method contains a custom command's execution logic?