Insight

Laravel framework 5.4 release

The Laravel framework is a PHP framework that was created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern.

January’s Laravel framework release saw a variety of new features, optimisations and tweaks. In this post I will list just a few of them:

Laravel Dusk

Laravel 5.4’s biggest addition is Laravel Dusk. The documentation describes this as:

“Laravel Dusk provides an expressive, easy-to-use browser automation and testing API. By default, Dusk doesn’t require you to install JDK or Selenium on your machine. Instead, Dusk uses a standalone ChromeDriver installation. However, you’re free to utilise any other Selenium compatible driver you wish.” – https://laravel.com/docs/5.4/dusk#introduction

Testing has finally become a big part of the PHP ecosystem, and rightly so! Who doesn’t want to save time with bugs and automate those tedious tasks?

The Laravel framework uses “Symfony Browserkit” for end-to-end tests to simulate web browsers, but what if your app uses Javascript/ AJAX to load the page? Laravel Dusk is the solution!

Laravel Dusk, is an end-to-end browser testing tool that uses a real browser to do real interactions (Click buttons, Complete forms, Drag and drop, etc). If Laravel Dusk encounters an error during it’s testing, it will even provide the user with a screen shot with what the error is and what the screen was showing at the time.

Laracasts have provided a great free tutorial on Laravel Dusk: https://laracasts.com/series/whats-new-in-laravel-5-4/episodes/9

Laravel Mix

In previous releases, Laravel has used Elixr as the frontend build tool. That being said Laravel Mix will replace Elixr moving forward. Don’t panic though, Elixr isn’t going anywhere for the time being.

Laravel Mix uses Webpack under the hood, whereas Laravel Elixr uses Gulp. As I have been using Webpack for sometime now, I welcome this change.

“Realtime” Facades

While the “static method war” continues to rage within the PHP framework community, Laravel has released “Realtime” facades that allow you to convert any of your classes into a facade by prefixing your imported class with them.

class ShippingController extends Controller {

use Facades\ {
App\Services\Shipping
};

public function index()
{
return Shipping::activeMethods();
}

}

From what I have seen, there are some very mixed reactions coming from the community with this new feature.

Smaller but notable features

  • Higher order collection messages
  • Job Level Retry & Timeout
  • Blade Components & Slots
  • Middleware: TrimStrings & ConvertEmptyStringsToNull
  • JSON based language files.
  • Custom pivot table models.
  • Resourceful Controllers with Model Boilerplate.
  • Map eloquent events to dedicated classes. (Object Based Eloquent Events)
  • Improved Redis Cluster Support
  • Migration Default String Length
  • Broadcast Model Binding
  • Markdown Mail & Notifications
  • Conclusion

As you can see Taylor & community have been very busy with this Laravel framework release. But, as always with the web development landscape it is always changing. Due to this, Taylor has asked for your ideas. The great thing about this wonderful community is that you can just jump in and get involved!


I hope you have enjoyed this brief update on the new Laravel framework release. To find out more about the experience that British Software Development have with Laravel feel free to contact us or read more about our bespoke software development.

Like what you see?

See what we can do for you ›