We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
New design
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.14.2.5. Artisan Utility

The Artisan utility is a console interface for working with the Laravel framework that 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:

  1. Change to your project directory by running the command:
    cd ~/example.com/www/

    Instead example.com/www indicate site root directory.

  2. By default in the environment SSH the hosting uses PHP 5.6. According to the requirements of the framework, a version of at least 7.3 is required, so override the paths in the variable $PATHby running the command:
    export PATH=/usr/local/php73/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
  3. Run the command to check if Artisan is working:
    php artisan
    • Subsequent command run artisan is only possible 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 based on the data you need:

      • Instead of "command»Specify the desired command name to be used. For example, you can specify the name of the project by type laravel_example.
      • Instead of "example.com/www»Specify site root directory.
    • Test the command by running:
      command -V

      The standard output of this command will be the version of the installed framework.

To list the available commands, run the following command:

php artisan list

For all commands, you can get 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:

You can familiarize yourself with how Artisan commands work in 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 Inspirational quote conclusion
list Getting a list of available commands
migrate Starting Database Migration
optimize Optimizing include files by creating cache files
serve Starting the server (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

1)
Russian-language unofficial documentation