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 9

Laravel 9 is here, and along with it comes a wide array of useful new features and tweaks. This includes an improved accessor/mutator API, better support for Enum casting, forced scope bindings, a new database engine for Laravel Scout, and so much more.

If you have 45 minutes to spare, I'll show you everything you need to know to get up to speed.

Progress

Series Info

Episodes
11
Run Time
44m
Difficulty
Intermediate
Last Updated
Feb 7, 2022
Version
Laravel 9

Series Episodes

  1. Episodes (11)
    1. Controller Route Groups

      First up on our list is a new Route::controller() method that may help to shorten and simplify routes that share a common controller namespace.
    2. Anonymous Migration Classes

      This next one is just a little tweak, but it's still something to be aware of. When generating migration classes, you'll notice that Laravel now leverages anonymous classes.
    3. New Helper Functions

      Upon installing Laravel 9, you'll notice two new global helper functions - str() and to_route(). Let's quickly review both.
    4. Refreshed Ignition Error Page

      Next up, you'll quickly notice that the Ignition team has freshened up Laravel's error page.
    5. Render a Blade String

      You may not reach for this next addition too often, but it's there when you need it. You can now, through a simple method call, render a Blade-formatted string to HTML.
    6. Forced Scope Bindings

      In Laravel 9, you can now "turn on" forced scope bindings in your route declarations through a simple method call. You may find that this adds just a bit more clarity and intent.
    7. Test Coverage with XDebug

      Recently, Laravel added a new php artisan test command to trigger suite. This functionality has now been extended to include generating a code coverage report. As long as you have Xdebug installed (which we'll do in this episode), you'll find this to be of great convenience.
    8. Laravel Scout Database Engine

      Laravel Scout originally launched with a focus on Algolia. However, since then, a number of alternative "engines" have been introduced. As part of Laravel 9, for small to medium sized applications, you may decide to leverage the new database engine.
    9. Full Text Indexing

      Laravel 9 also includes better support for MySQL or PostgreSQL full text indexing. You'll find a new fulltext() method when preparing new migrations, as well as a whereFulltext() method on your Eloquent builder.
    10. Enum Attribute Casting

      Now that PHP 8 offers first-class support for enums, Laravel 9 has been updated to include Eloquent attribute casting to and from an enum object.
    11. Simplified Accessors and Mutators

      Laravel's traditional getXAttribute and setXAttribute API for declaring accessors and mutators is not going away; however, there's a new, simplified approach that will be recommended going forward. Let's have a look.

Continue Learning