On the Tighten.co blog they have a new post that aims to help you get the most out of the Laravel command line tool's (artisan)
Laravel's command line tool is called "Artisan," and it comes with a few powerful features out of the box. Tinker, accessed via php artisan tinker, is arguably my favorite Artisan command. It speeds up my workflow and allows me to interact with my application in ways I would have never thought possible.
Tinker is a REPL (read-eval-print loop). A REPL gives you a prompt that allows you to interact with your application using your language's native syntax (in this case, PHP) in a command-line style.
The post then walks through some of the "hidden features" this command line tool offers including:
- basic usage to call Laravel code (like getting all posts using
- a more interactive version of
dd(), a debugging tool
- improving speed on a Laravel Dusk testing workflow
- direct access to the PHP docs
The post ends with a few other smaller things this helpful tool can do like showing a stack trace, listing the command history and re-throwing the last exception.