Laravel framework is undoubtedly the most popular PHP frameworks available today that is exclusively designed for development of model view controller (MVC) applications. The Laravel framework comes with some fantastic features inbuilt making it so popular among developers around the globe.

Laravel has launched its latest version Laravel 5.4, which has gained some serious interests among tech enthusiasts. Laravel 5.4 continues the improvements made in Laravel 5.3 by adding in some excellent new optimizations and features such as Like Markdown mail, Dusk, Mix, Real-time facades etc.which we will discuss in larger detail this blog. In addition to the new features being added, the entire code base of the framework is reviewed and restructured making it even cleaner.

Now, let’s talk about the all new features in Laravel 5.4 :

  • Markdown Mail & Notifications
  • Laravel Dusk
  • Laravel Mix
  • Blade Component and Slots
  • Broadcast Model Binding
  • Collection Higher Order Messages
  • Object based Eloquent Events
  • Job Level Retry and Timeout
  • Request Sanitization Middleware
  • “Realtime” Facades
  • Custom Pivot Table Models
  • Improved Redis Cluster Support
  • Migration Default String Length

Markdown Mail & Notifications

Laravel 5.4 comes with pre-built Markdown email templates and mail notifications into your mailables. Markdown templates have the ability to produce beautiful clean HTML mails and the same time it has the ability to make plain text mail.

Laravel Dusk

Laravel dusk is an end-to-end testing tool that allows testing javascript driven interactions such as clicks, focus etc. For example, You can test using dusk whether the user is entered to the correct page after login. Dusk is run along with standalone chromeDriver installation.

Laravel Mix

Laravel mix is firstly introduced in Laravel 5.4, which is a successor of Gulp based Laravel Elixir. It is based on webpack. In Mix, you can build asset pipeline using simple method chaining.

Blade Component and Slots

Blade Component and Slots provides the same usage of sections and layout. For example, consider the following reusable alert message

The variable $slot contain the content that we wish to inject. We can use @component directive to define the content that is to be injected.

It also supports named slots which allow  providing multiple slots into a single component.

Broadcast Model Binding

In Laravel 5.4, Broadcast model binding we can request the entire Model instead of requesting numeric order id or something else. For example:

It binds Order model to the channel route. Broadcast Model Binding is very helpful in making realtime applications such as livechat sytems, live boards etc.

Collection Higher Order Messages

Collections in Laravel 5.4 now supports higher order messages. Higher order messages are shortcuts for actions performable on collections. The collection methods that provide higher order messages are: contains, each, every, filter, first, map, partition, reject, sortBy, sortByDesc, and sum.

For example:

$users = User::where(‘group’, ‘Development’)->get();

$users is the collection of users under the group Development. Suppose we need to get the sum of any field say ‘votes’, we can use higher order message ‘sum’ as follows

$votes = $users->sum->votes

Object based Eloquent Events

Now we can use event models as eloquent event handlers. We can define the event handlers in the $events array on your Eloquent model. The following example shows the usage of Eloquent event:

Job Level Retry and Timeout

Instead of configuring retry and timeout globally, Laravel 5.4 allows it to configure them on the Job class itself, so it allows configure retry and timeout per job basis.

Request Sanitization Middleware

It introducing two new middlewares on Laravel’s default middleware stack viz. TrimStrings and ConvertEmptyStringsToNull. As the names indicates TrimStrings will trim all the strings on request and ConvertEmptyStringsToNull will convert all the empty strings to null value.

Realtime Facades

In Laravel 5.4, you can easily convert your application class into a facade. Previously, you could only use built-in facades in your application.

We can easily use the class Student as a facade like:

Custom Pivot Table Models

In Laravel 5.4 we can define custom models for our pivot tables. By using ‘using’ method we can define the relationship for the custom model.

Improved Redis Cluster Support

In previous versions of Laravel, clustering of the single host in the same application was not possible. In Laravel 5.4, you can now define Redis connections to multiple single hosts and multiple clusters within the same application.

Migration Default String Length

The default character set for Laravel 5.4 is utf8mb4, which has support for storing emojis in the database. If we choose to switch to this character set manually and are running a version of MySQL older than the 5.7.7 release, it may need to manually configure the default string length generated by migrations within our AppServiceProvider.


Laravel 5.4 came up with the these latest features which will help ease the developer’s coding effort and helps the client to get best user experience through Laravel based responsive web solutions. In this blog, I’ve only briefly explained the key features of Laravel 5.4. Will update more about laravel framework in my upcoming blogs.

Cubet Techno Labs is one of the pioneers who understood the benefits of Laravel and adopted it as a core technology stack. We are one of noted Laravel application development company having experience working with some of largest Laravel based applications.

To add a final note, every new Laravel Development projects at Cubet will be shipped and coded in 5.4 from now.

Talk to our Laravel Professionals

Other Blogs:


Post By : Aneesh K (4 Posts)

"Aneesh is a Software engineer at Cubet Techno Labs with experience in both backend and front-end website development. He has rich experience in various technologies over different platforms such as PHP frameworks (CakePHP, Codeigniter, Laravel, Zend), PHP based CMS (PHPFOX, Wordpress, Social Engine, Magento, Interspire, Joomla, Bigcommerce), HTML,CSS, AJAX, jQuery, javascript, and MYSQL. He also posses good knowledge in development based on REST, SOAP, RPC, Integrations based on web service providers like Mandrill, Salesforce, Youtube, Facebook, LinkedIn, Twitter, etc., and information processing using webhooks. Besides these technical skill-sets he is a good team player and quick learner of new technologies."

You might also like...

+91 484 4054324
Skype : cubettech
Leela Info Park,
Unit IX-C, 9th floor PhaseIV,
Kochi, Kerala, India

+44 2071938618
Skype : cubettech
Kemp House
160 City Road
London- EC1V2NX, UK.