The Artisan utility is a console interface for working with the Laravel framework, which comes with it and is installed with project creation... This utility simplifies the work with the framework and provides a huge range of possibilities.
The utility and its commands are launched directly from the framework project directory. To use do the following:
cd ~/example.com/www/
Instead example.com/www
indicate site root directory.
$PATH
by running the command:export PATH=/usr/local/php73/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
php artisan
artisan
possible only from its catalog. If you need to create a command that will be called without the need to go to the directory, then run the following command:echo "alias command='/usr/local/php73/bin/php ~/example.com/www/artisan'" >> ~/.bashrc && source ~/.bashrc
Modify the above command depending on the data you want:
laravel_example
.command -V
The standard output of this command will be the version of the framework installed.
To list the available commands, run the following command:
php artisan list
All commands can be provided with help on how to use them. To do this, use the command help
with the name of the command for which you want to get information:
php artisan help list
If you enter a command incorrectly, similar options will be offered, for example:
To see how Artisan commands work, see laravel.su documentation1) or in official documentation.
Command | Description |
---|---|
Basic commands | |
clear-compiled | Remove compiled class files |
down | Enable maintenance mode / demo mode |
env | Displaying the current parameters of the framework environment |
help | Help output on command |
inspire | Conclusion of an inspiring quote |
list | Getting a list of available commands |
migrate | Starting database migration |
optimize | Optimizing include files by creating cache files |
serve | Server start (within the framework of shared hosting, the command will not work correctly) |
test | Run application tests |
tinker | Interacting with the application |
up | Disable Maintenance Mode / Demo Mode |