This article was published over a year ago, so please be aware that some content may be out of date.
Reset Your Laravel App In Seconds
In his recent talk about Laravel Nova at Laracon US, Taylor Otwell used a nice little shortcut to reset his demo app during the presentation.
In his recent talk about Laravel Nova at Laracon US, Taylor Otwell used a nice little shortcut to reset his demo app during the presentation. To reset an app in our local environment, we need to do three things:
- Drop the database.
- Migrate the database.
- Seed the database.
As of Laravel 5.5, we've been able to to use the following command to perform all three actions at once:
php artisan migrate:fresh --seed
That's still quite a lot to type if you are using this command over and over, so let's add a quick alias to our bashrc
or zshrc
:
alias mfs="php artisan migrate:fresh --seed"
Now you can simply type mfs
to quickly refresh your application and reseed it with fresh data.
While I've got your attention, Taylor's talk is well worth watching. I always learn something new from his presentations. I love the way that he can abstract a concept to the point where thousands of developers can use it in their own projects.
This article describes the process you can follow to build the Imagick PHP extension from source, which can be handy if the version you are after has not been released via PECL.
In a post called The Life Changing Magic of Tidying Up Code, Kent Beck outlines his philosophy on cleaning up code. The article results in a short list of easy-to-follow rules, which I'm sure he would agree are there to be broken.