Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Browse all series

What's New in Laravel 5.4

It's that time of year again! Laravel is on the cusp of graduating to version 5.4. Along with it comes a variety of excellent new optimizations and features. Markdown mail, higher order collection messages, Dusk, real-time facades... yes, please! In this series, I'll get you up to speed on what's new in Laravel 5.4 as quickly as possible.

Progress

Series Info

Episodes
10
Run Time
32m
Difficulty
Intermediate
Last Updated
Jan 24, 2017
Version
Latest

Series Episodes

  1. Episodes (10)
    1. Sanitizing Middleware

      First up for this series is a review of two new middleware that are included with Laravel out of the box: TrimStrings and ConvertEmptyStringsToNull. In effect, for every form request, Laravel will automatically trim any white space, while also converting all empty request fields to null.
    2. Higher Order Collection Messages

      Laravel 5.4 includes support for higher order messaging, which is a fancy term that essentially breaks down to "collection shortcuts." What if, rather than filtering a collection, passing a closure, and returning some data, you could simply type: $collection->filter->isArchived()? How cool is that? I'll show you how it all works in this episode.
    3. Laravel Mix in a Nutshell

      As part of Laravel 5.4, Laravel Elixir has been upgraded and renamed to Laravel Mix. While both versions will continue to exist, Mix should be your build tool wrapper of choice. It's built on Webpack, and provides nearly the exact same friendly API that you're already used to.
    4. Fluent Routing

      Laravel 5.4's routing component has been upgraded to support a more fluent routing syntax. No longer are you required to reference an array of awkward options, should you require a route group, prefix, or name.
    5. Resourceful Controllers With Model Boilerplate

      When generating a controller from the command line (php artisan make:controller), you'll now find a new --model flag. When called with the name of a model, Laravel will automatically generate a resourceful controller that includes the necessary boilerplate to inject this model in all relevant controller actions.
    6. Blade Components and Slots

      In Laravel 5.4, Blade offers a new @component directive. With this new addition, you may now, where relevant, think in terms of components and slots (much like Vue's implementation). Define a view partial, reference any necessary variables, and then call this component from any other view. It's probably best if I simply show you!
    7. Real-Time Facades

      By now, you're surely well aware that Laravel offers facades, which offer a simple, static interface to objects in your service container. In the past however, should we have needed to create our own facades, we were required to manually construct each relevant facade. Not anymore! Laravel 5.4 can do it on-demand for you. This is insanely cool, and will annoy countless onlookers. So they're definitely worth a look.
    8. Map Eloquent Events to Dedicated Classes

      As part of Laravel 5.4, you may now map any Eloquent events (created, saved, deleted, etc.) to dedicated event classes. You'll find that this method cleans up your model code significantly.

Continue Learning