Will the new Laravel release save PHP?

Will the new Laravel release save PHP?

The blog is based on the officially available information from the developers prior to publication.

Is PHP Dying?

This shouldn't come as news to those who are familiar with web development, but PHP is slowly dying. Most of the web, as of today is powered by PHP. But new websites and startups are slowly moving to more flexible and feature-rich frameworks like NodeJS stack, DJango and Flask.

But the recent release of Laravel 10 this February has changed the tides in favour of PHP. This new release comes with interesting features and upgrades that might just save PHP from dying and in this blog we are going to understand why.

What is PHP?

PHP is a widely used general-purpose and open-source scripting language geared toward web development.

PHP is an acronym for Hypertext Preprocessor.

PHP powers 77.6% of all the websites on the internet, whose server-side programming languages are known. It builds the core of the biggest blogging system on the web, WordPress. It builds social media web applications like Facebook, Whatsapp, and Pinterest. Even Wikipedia runs on PHP.

What is Laravel?

Laravel is a free and open-source PHP web framework based on Symfony, that provides tools and resources to build modern PHP applications.

What's New and Different?

The new Laravel 10 brings about some key and important changes over its predecessors. It comes with a minimum requirement of PHP 8.1 and support for v8.2, Laravel Starter Kit upgrades, Predis version upgrades, native type declarations, and more. We discuss these key changes in detail below.

  • One of the major changes is requiring the latest updated versions of PHP, letting it take full-featured advantage of the scripting language.

  • Another major change was, Laravel comes with an authentication scaffold, that simplifies the authentication set-up process for web applications.

  • Testing became easier than ever with the implementation of the new flag
    --dev.

      laravel new <your-project-name> --dev
    
  • Laravel 10 comes with a new feature --profile, that allows us to find out slow 'tests' in our application. This option helps us to keep our tests fast and helps us find and fix the slow tests. It also allows us to group slow tests together to make it easier for us to run them only when they are needed.

  • One of the new features includes a method Str::password

      use Illuminate\Support\Str;
    
      $password = Str::password();
    
      // 'EbJo2vE-AS:U,$%_gkrV4n,q~1xy/-_4'
    
      $password = Str::password(12);
    
      // 'qwuar>#V|i]N'
    

Laravel Pennant

Laravel Pennant is a core package developed by the Laravel team. It is introduced in Laravel 10 and will be providing feature flags for your application.
Since it is designed by the Laravel team, we can expect a well-built and well-tested package.

Laravel Process Layer

The Laravel Process Layer makes testing and running CLI processes buttery smooth.

The Process layer includes rich features out of the box, such as:

  • Fluent process methods to build a process instance before running it

  • Process output handling as it is received

  • Asynchronous processes

  • Process Pools

  • Rich testing features via fake()

  • Preventing stray processes during tests

Ending Thoughts

As we have explored so far, Laravel 10 is a huge upgrade over the previous versions and provides features and functionality that will make PHP still a viable choice in this age of competing web frameworks.

To upgrade to the latest Laravel 10 and automate keeping the framework up to date, the easiest way is to utilize Laravel Shift.

To perform the above follow this Upgrade Guide.

Please check out the Official Release Pages to look for updated information.

Methods marked as deprecated in Laravel 9 will be removed in Laravel 10. The release upgrade guide above will outline all the deprecated methods, potential impact assessment, and how to upgrade closer to the release.