Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Tighten.co:
Supercharge Your Laravel Tinker Workflow
May 11, 2017 @ 14:37:19

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) tinker command.

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 Post::all)
  • 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.

tagged: laravel workflow tinker commandline tool artisan tutorial

Link: https://blog.tighten.co/supercharge-your-laravel-tinker-workflow


Trending Topics: