A Few Words On Artisan
A few words on Artisan
There's one last topic to touch on before finally get your hands into writing some code. Artisan.
What is Artisan
Artisan in a command line tool build into Laravel. Artisan offers a number of tools to help with the development, management, and maintenance of your web application. When you have a terminal window open to the directory of a Laravel installation, you have immediate access to artisan.
Artisan and Docker
Since Artisan needs access to the full runtime Laravel environment, you will want to execute Artisan commands within the Docker container provided by Sail. This is a simple matter of prepending all Artisan commands with
For example, if you see instructions to execute
artisan route:list, you should instead run
sail artisan route:list.
One of the features of Artisan which will you can make use of early on is code generation. Artisan has several built-in templates for common file types via
make commands, and provides you a quick and easy way to create a starting point for many situations.
Upcoming tutorials will guide you to use
sail artisan make commands to generate Tests and Controllers, amongst other things.
Much more than Code Generation
Artisan is a very powerful tool, and I encourage you to explore the full list of commands available. To get a full listing of available artisan commands:
Artisan is also extensible. You can write code to add new functionality to Artisan, or download third-party packages, created by other developers, to add features.