ØFrom installation onward, modern PHP frameworks
expect many interactions to take place on the command line.
ØLaravel provides three primary tools for
command-line interaction: Artisan, a suite of built-in command-line actions
with the ability to add more; Tinker, a REPL or interactive shell for your
application; and the installer, which we’ve already covered in this chapter.
ØIf you’ve been reading through this book chapter by
chapter, you’ve already learned how to use Artisan commands. They look
something like this:
php artisan make:controller PostsController
ØIf you look in the root folder of your application,
you’ll see that artisan is actually just a PHP file. That’s why you’re starting
your call with php artisan; you’re passing that file into PHP to be parsed. Everything
after that is just passed into Artisan as arguments.
ØSince the list of Artisan commands for an
application can be changed by a package or by the specific code of the
application, it’s worth checking every new application you encounter to see what
commands are available.
ØTo get a list of all available Artisan commands,
you can run php artisan list from the project root (although if you just run
php artisan with no parameters, it will do the same thing).
No comments:
Post a Comment