Skip to main content
INFYNNO
INFYNNO
Infinite InnovationsInfinite Innovations
  1. Home
  2. Articles
  3. Laravel 9 New Features

Laravel 9 New Features

The first Long Term Support update in a 12-month cycle is supposed to be Laravel 9, which was initially scheduled to arrive by September 2021.

B

Bhavdip Pambhar

Author · Infynno Solutions

Dec 5, 202214 sections
Laravel

At a glance

CategoryDevelopment
Sections14 topics
AuthorBhavdip Pambhar
PublishedDec 5, 2022
Start reading
Laravel 9 New Features

Laravel 9

The first Long Term Support update in a 12-month cycle is supposed to be Laravel 9, which was initially scheduled to arrive by September 2021. However, it was later decided to push it until January 2022. Due to Symfony’s intention to release Symfony v6.0 by November 2021 and Laravel’s system dependencies in various community-driven and Symfony 9 modules, the Laravel team decided to postpone the release of Laravel v9. It will take some time and a lot of testing and monitoring against breaking changes before the full Laravel framework is updated to the most recent Symfony version and released to the public. At last, deferring the release of Laravel 9 till January 2022 will better position the Laravel team to release the ensuing LTS annually. Giving the Laravel team two months following the launches of Symfony Now that you are aware of the rationale behind the changes, let’s examine the new Laravel v9 ahead of its scheduled release on January 22, 2022.

 

Laravel 9 New Features

Laravel 9 introduced several improvements that made application development cleaner, safer, and more convenient. Along with support for PHP 8, Laravel 9 brought improvements to migrations, routing, database queries, file storage, authentication, and developer tooling.

Minimum PHP Requirement:

The most recent versions of PHP 8, PHPUnit 9, and several additional requirements will be required for Laravel 9 in the future. As a framework, Laravel is dependent on a number of open-source Symfony 9 libraries. Laravel’s development team was forced to postpone the release of Laravel v9 since Symfony intended to deliver version 6.0 by November 2021. The need for PHP 8 is due to Laravel 9’s reliance on Symfony’s most recent v6.0 version, which only works with PHP 8. To further understand PHP 8’s improvements and features, from the Just-In-Time compiler (JIT) to function Object() { [native code] } property promotion, you may study what is new in PHP 8 and the unique PHP version benchmarks.

 

Anonymous Stub Migration

When using the well-known migration command, Laravel makes anonymous stub migration the default action:

In order to address the Github issue, the anonymous stub migration capability was initially included in Laravel 8.37. Multiple migrations with the same class name might cause problems when trying to reconstruct the complete database, which is where the problem arises. Collisions in migration class names are eliminated by the stub migration feature.

Here is the sample code snippet of what the new migration file will look like:

laravel-9-migration.png

Instead of the standard schema::create() function, this code sample employs schema::table.

New Interface for Query Builder

Type hinting in Laravel 9 is quite dependable for refactoring, inactive analysis, and code completion in their IDEs. This is because QueryBuilder, EloquentBuilder, and EloquentRelation all require a shared interface or inheritance. Engineers may still enjoy the new query builder interface for type hinting, refactoring, and static analysis with Laravel 9.

The necessity for a shared interface or heritage between QueryBuilder, EloquentBuilder, and EloquentRelation might be substantially more challenging for developers who rely on sort insights for static analysis, refactoring, or code completion in their IDE.

query-Builder.png

This release introduced the new Illuminate\Contracts\Database\QueryBuilder interface, in addition to the Illuminate\Database\Eloquent\Concerns\DecoratesQueryBuilder, trait which implements the interface in place of the __call magic function.

Controller route groups

You can now use the controller method of the Laravel 9 Route class to define the controller that will be used for every route in a route group.

route-controller-group.png

Scout’s new database engine

The new Laravel Scout database engine is included with Laravel v9. It gives Eloquent models full-text search capabilities. It employs model observers to keep search indexes in sync with Eloquent records and is suitable for applications that use a small or medium-sized database or have a mild workload. When filtering results from your database, this engine will employ “where-like” clauses.

Simply add the LaravelScoutSearchable trait to a model to utilise it:

laravel-scout-searchable.png

Want us to build this for you?

Infynno builds AI-powered software for EdTech, enterprise, and SaaS teams. Free discovery call · NDA first.

Book Free Discovery Call

Route bindings with forced scope

In a route definition, Laravel 9 can now automatically scope the query to get a nested model by its parent by utilizing conventions to infer the parent’s relationship name. Here’s an example of how to use scope bindings:

scope-bindings.png

Alternatively, you may tell a whole collection of route declarations to utilize scoped bindings: 

group-of-route-definitions-to-use-scoped-bindings.png

Str

Laravel’s Illuminate\Support\Str facade will now employ PHP 8 string functions, which include new methods such as str contains, str starts with, and str ends with. Append and the snake is two new assistants.

str_function.png

to_route

To expressively redirect to named routes from your routes and controllers, use the to route method, which creates a redirect HTTP response for a given named route:

to_route.png

 

 

Flysystem 2.0

Flysystem 2.x has replaced Flysystem 1.x in Laravel 9. Flysystem is the engine that drives all of the record modification techniques offered by the Capacity façade. Due to this, your application may need to make a few adjustments. In any event, we made an effort to make this change as logical as we could.

Symfony Mailer

The switch from SwiftMailer, which won’t be supported after December 2021, to Symfony Mailer is one of Laravel 9.x’s largest changes. However, Laravel made an effort to make this action as uniform as is practical for your apps. In light of this, it would be excellent if you carefully read the list of modifications below to make sure your application is flawlessly consistent.

The lang Directory

The resources/lang directory is currently found inside the root project directory in Laravel 9 apps (lang). Make sure your package is publishing to app()->langPath() rather than a hard-coded location if it is publishing language files to this directory.

The Password Rule

The password rule has been changed to the current password, and it now verifies that the input value provided matches the confirmed user’s current password. The unless and when methods As you may be aware, different classes throughout the framework include when and unless methods. If the first method argument’s boolean value evaluates to true or false, these methods can be used to conditionally carry out an action.

 

Our team completed 25+ projects on Laravel development.

We make startup ideas a reality. Do you want to launch your company idea? Infynno Solutions helps you in bringing your concept to reality and design it. Let’s connect and discuss.

B

Bhavdip Pambhar

Author · Infynno Solutions

Dec 5, 2022

Share

𝕏LinkedIn

On this page

Laravel 9Laravel 9 New FeaturesMinimum PHP Requirement:Anonymous Stub MigrationNew Interface for Query BuilderController route groupsScout’s new database engineRoute bindings with forced scopeStrto_routeFlysystem 2.0Symfony MailerThe lang DirectoryThe Password Rule

Building something like this?

Free discovery call. NDA before we go further.

Book a free call
B

Bhavdip Pambhar

Author

Engineer at Infynno Solutions building AI, EdTech & enterprise software products.

More from the blog

All articles
Effective Next.js Optimization Strategies to Improve App Performance
DevelopmentSep 5, 2024

Effective Next.js Optimization Strategies to Improve App Performance

When you’re working on a Next.js app, you’ve probably had those moments where you’re like, ‘Why is the app moving so slowly?’ Recently, I received a project where the performance of a Next.js app was not up to the mark. So, as a team, we discussed and identified some effective Next.js optimization strategies and use cases where the app needs the most improvement.

Bhavdip Pambhar
Why should you use Tailwind CSS in your next project?
DevelopmentApr 14, 2023

Why should you use Tailwind CSS in your next project?

Nowadays lots of buzz about Tailwind CSS. So, What are some strong reasons to adopt Tailwind CSS for your upcoming project?

Bhavdip Pambhar
Laravel tips
DevelopmentDec 5, 2022

Laravel tips

A reliable and easy-to-understand PHP framework, Laravel is available as open-source software. It is utilized to create a vast array of unique web apps. The model-view-controller design pattern is supported.

Bhavdip Pambhar
InfynnoInfynno

Infynno is an AI-native product engineering company helping businesses build, modernize, and scale software products through AI, automation, and experienced engineering teams.

Trusted worldwide

Google
Google
4.9
22 reviews
Clutch
Clutch
4.9
8+ reviews
Upwork
Upwork
Top Rated
8K+ Hours, 20+ Jobs
Glassdoor
Glassdoor
5
18 reviews

Trusted worldwide

Google
Google
4.9
22 reviews
Clutch
Clutch
4.9
8+ reviews
Upwork
Upwork
Top Rated
8K+ Hours, 20+ Jobs
Glassdoor
Glassdoor
5
18 reviews

Engineering Services

  • AI Strategy & Consulting
  • AI Integration
  • AI Automation & AI Agents
  • IT Consulting
  • Web Development
  • Product Development
  • AI Search Visibility (AEO + GEO)
  • Social Media and Branding

Edtech Industry Expertise

  • Learning Management Software
  • Exam Preparation Platform
  • Tutor Management Software
  • Medical Entrance Exam Platform
  • Scholarship Exam Platform
  • AI For Education
  • EdTech Mobile App Development

Company

  • About Infynno
  • Our Work
  • Client Success Stories
  • Life @ Infynno
  • Contact Us

Resources

  • Case Studies
  • Guides
  • Blogs
  • FAQs
  • Open Source & Community
  • Careers

Contact

  • Project Inquiry

    sales@infynno.com
  • HR & Careers

    hr@infynno.com
  • Phone

    +91-84888-38308

Office address

India

Ahmedabad, India

E-720 Ganesh Glory 11,

Nr. BSNL Office, Jagatpur Road,

Gota, S.G. Highway,

Ahmedabad - 382481, Gujarat

IST · UTC+5:30

Trusted worldwide

Google
Google
4.9
22 reviews
Clutch
Clutch
4.9
8+ reviews
Upwork
Upwork
Top Rated
8K+ Hours, 20+ Jobs
Glassdoor
Glassdoor
5
18 reviews
ISO 27001:2022 certified company

An ISO 27001:2022 Certified Company

  • LLP Identification Number - AAZ-7794

© 2026 Infynno Solutions LLP. All rights reserved.

Privacy PolicyTerms of UseCookie PolicySitemap
Infinite Innovations