Console Commands
- Introduction
- Writing Commands
- Defining Input Expectations
- Command I/O
- Registering Commands
- Programatically Executing Commands
Introduction
Artisan is the command-line interface included with Laravel. It provides a number of helpful commands that can assist you while you build your application. To view a list of all available Artisan commands, you may use the list
command:
php artisan list
Every command also includes a "help" screen which displays and describes the command's available arguments and options. To view a help screen, simply precede the name of the command with help
:
php artisan help migrate
Writing Commands
In addition to the commands provided with Artisan, you may also build your own custom commands. Commands are typically stored in the app/Console/Commands
directory; however, you are free to choose your own storage location as long as your commands can be loaded by Composer.
Please login to continue.