In this post I’d like to share some of the packages that make developing a Laravel app easier.
This package really needs no introduction as it is one of the most popular packages around. It’s made by Barry Vd. Heuvel and it’s a real powerhouse. Once the package is installed it displays a debugbar in your browser that shows a lot of useful info such as the executed queries, which views are used, which controller built up the page, and much much more.
This package, also made by Barry, can generate some files that help an IDE provide improved autocompletion. Using this package PHPStorm can autocomplete methods on facades, classes resolved out of the container and model properties.
Those who are already using Laravel for quite some time know that Laravel 4 provided an artisan command to tail the Laravel default log. Unfortunately in Laravel 5 that command was axed. This package brings it back.
With the package installed you can just run
php artisan tail to tail the log.
Laravel 5.3 introduced mailables. A mailable is a class that takes care of everything regarding sending a mail.
One of the things that is not so easy to in a vanilla Laravel app is testing such a mail. In order to for example let your app send an order confirmation mail you have to go through the entire checkout process. The laravel-mailable-test package can make the mailable testing process a lot easier. It provides an artisan command that can send a mailable to a specific mail address.
The package will provide a value for any typehinted argument of the constructor of the mailable. If an argument is a int, string or bool the package will generated a value using Faker. Any argument that typehints an Eloquent model will receive the first record of that model.
If you want to learn more, read this introductory blog post about it.
Made by Mohamed Said, this package can help you test a flow where mail is involved. Instead of sending the actual mail that package will save the mail to the filesystem. In the browser it will display a little notice that a mail was sent. Clicking on the link in that notice will display the saved mail right in your browser.
Here’s a short movie clip that shows how it can be used to test a password reset.
In my projects I have never run a down migration. So I don’t bother with coding up the down steps. And without those down steps running Laravel’s
migrate:refresh will result in errors. If you think skipping writing down steps is lazy, read this comment Adam Wathan made on Reddit.
The laravel-migrate-fresh package provides an artisan command that can knock out all your tables without using down steps of a migration.
Do you know some other indispensable package that makes developing a Laravel app easier? Let me know in the comments below.