[00:00]
Welcome back to the channel.
[00:02]
If you are a Laravel developer, this
[00:04]
video is for you.
[00:06]
Today, we are going to talk about
[00:08]
Laravel 13, which is released recently
[00:11]
on March 3rd week, 2026.
[00:16]
In this video, I will explain you the
[00:18]
main updates in simple way, including
[00:20]
new features, improvements, and removed
[00:23]
items with a clear examples.
[00:26]
The best part,
[00:27]
Laravel 13 has no breaking changes. It
[00:30]
is one of the easiest major Laravel
[00:33]
upgrades, and many apps can be upgraded
[00:37]
very quickly.
[00:39]
But, there is a still many exciting
[00:41]
updates like AI features, especially
[00:45]
uh passkey authentication, web socket,
[00:48]
web socket improvements, and PHP
[00:50]
attributes.
[00:53]
Let's get started.
[00:55]
Now, the agenda.
[00:57]
What we will cover in this video. What
[01:00]
we will cover today.
[01:02]
This video has 10 main sections. If you
[01:05]
can see,
[01:08]
PHP attributes,
[01:10]
release overview,
[01:11]
cache queue updates, JSON API resources,
[01:13]
Laravel AI SDK, especially.
[01:17]
Right? That is the powerful feature of
[01:20]
Laravel 13. That is nothing but AI SDK.
[01:24]
I hope
[01:25]
in future releases also, in every
[01:29]
Laravel new version release, definitely
[01:31]
they will integrate AI and AI related
[01:34]
integrations, I'm sure.
[01:36]
Because everyday AI today in the market.
[01:39]
Right? Like you can see other other
[01:41]
features also, passkey authentication,
[01:43]
and what removed, what is deprecated.
[01:45]
Right? Let's talk about this.
[01:48]
So, let's have a overview of the
[01:51]
release.
[01:53]
So, Laravel 13 was released on March 17,
[01:56]
2026.
[01:57]
PHP 8.3, that is a minimum requirement.
[02:00]
There is no breaking changes. Bug fixes
[02:03]
support is available until Q3 2027, as
[02:06]
well as the security fixes support is
[02:08]
available up to Q1 2028. Maybe around 2
[02:11]
years is there. Now, let's talk about
[02:14]
the
[02:15]
the big feature, that is nothing but
[02:17]
native PHP attributes. This is also
[02:20]
called hash bracket syntax. If you don't
[02:22]
know, don't worry, I will create
[02:24]
separate video on what is a hash bracket
[02:26]
syntax, how that is work.
[02:28]
So, this hash bracket syntax is
[02:30]
introduced in PHP 8 version.
[02:33]
But, Laravel did not use them much
[02:35]
before. Now, Laravel 13 uses them in a
[02:39]
much better way.
[02:42]
So, what is the syntax will do? We just
[02:44]
if we can observe, before Laravel 12,
[02:46]
after Laravel 13.
[02:48]
Can you see in Laravel 12, we have a
[02:51]
model. In that model, we are defining
[02:53]
the properties like table, primary key,
[02:55]
key type, increment, fillable, casts,
[02:58]
hidden, and lot of things we can define.
[03:00]
But, they're all inside the class. But,
[03:02]
if you can see Laravel 13, what is
[03:05]
there?
[03:07]
Much of the configuration can be written
[03:10]
using PHP attributes just above the
[03:12]
class.
[03:14]
All these properties are going to become
[03:16]
into a configuration, which are going to
[03:19]
be defined inside hash bracket syntax.
[03:22]
This keeps the class very clean and
[03:24]
makes you main logic very easier. So,
[03:27]
what we will do? Any logic you want
[03:29]
Right, you can write that in the class.
[03:31]
And we don't want to write those
[03:33]
properties inside the class.
[03:35]
The best part is, one thing remember,
[03:37]
this feature is optional. Old code will
[03:39]
work still without any changes.
[03:42]
But, my suggestion, we are using Laravel
[03:44]
13, so let us go with Laravel 13.
[03:48]
So, we don't know what is going to be
[03:49]
happen in future. So, but as of now,
[03:52]
both are compatible. If it is a Laravel
[03:54]
13 version, you can use
[03:56]
the eloquent model how you define
[03:59]
previously,
[04:00]
or now you can use the same 13 way, that
[04:02]
is nothing but hash bracket syntax. You
[04:05]
can exactly we can use this hash bracket
[04:07]
syntax.
[04:09]
The PHP attributes not only for eloquent
[04:11]
models, and they are available many
[04:14]
places.
[04:16]
Some common examples if we can see, we
[04:17]
just now we seen eloquent models for
[04:20]
defining the tables, primary keys,
[04:21]
fillable, casts, and all for defining,
[04:23]
we can use the eloquent models. Not only
[04:25]
this,
[04:26]
for working with artisan commands also,
[04:29]
in artisan commands where we can define
[04:30]
the signature and description,
[04:32]
and jobs, some job classes are there to
[04:36]
set the queue connections, so queue
[04:38]
name, and retry attempts.
[04:42]
We have event listeners, define which
[04:44]
event listener should handles.
[04:46]
So, we can all define notifications,
[04:48]
mailables, broadcast events, all of the
[04:52]
configuration,
[04:53]
all of these related configurations, we
[04:55]
can keep into this hash bracket syntax.
[04:58]
These are the some common places.
[05:00]
Definitely, I'm sure in upcoming
[05:02]
sessions, we will discuss about this.
[05:04]
And one more thing, these all attributes
[05:07]
are 100% optional.
[05:09]
Now, the next one, Laravel AI SDK.
[05:14]
The Laravel AI SDK was in beta before,
[05:17]
but from this latest release, it is a
[05:20]
stable and ready to use for production.
[05:24]
It is an official Laravel package
[05:26]
that gives you a simple and common way
[05:29]
to work with the AI providers like
[05:31]
OpenAI, Anthropic, and Gemini, and other
[05:34]
AI providers.
[05:36]
So, we can work with them very easily
[05:37]
without using any third-party package.
[05:40]
This Laravel AI SDK package is provided
[05:43]
by the Laravel itself. We don't want to
[05:45]
go for any third-party.
[05:47]
So, the as of now, we can see some of
[05:49]
the powerful features, text generation
[05:52]
with AI agents, image generation, audio
[05:55]
and text-to-speech,
[05:58]
and embeddings, and vector search. All
[06:00]
how we are doing? So, with just with the
[06:03]
help of prompts, we are generating all
[06:05]
these things, right? Definitely, these
[06:07]
features are going to be available in
[06:09]
Laravel also with this package. If you
[06:13]
want to implement AI-powered search
[06:16]
functionalities in your website,
[06:18]
definitely, this package will makes a
[06:21]
blow. I'm I'm sure
[06:23]
in future also, any new releases coming
[06:27]
from Laravel, definitely, they will come
[06:29]
with new integrations for AI.
[06:31]
I'm sure.
[06:32]
Every release, you know, we are in 13,
[06:34]
maybe 14, 15, 16, every new release,
[06:38]
definitely, they will come with a new AI
[06:40]
integrations. So,
[06:43]
If you can see, Reverb database
[06:46]
driver.
[06:48]
This is a very useful update in Laravel
[06:50]
13 about this Reverb
[06:52]
database driver.
[06:54]
Laravel Reverb is a Laravel's official
[06:56]
web socket server.
[06:58]
Earlier, if you wanted to run Reverb on
[07:01]
multiple servers, you need Redis
[07:03]
database for this to messages between
[07:06]
the multiple servers, to communicate
[07:07]
between the multiple servers. Now,
[07:09]
Laravel 13 adds a new database driver
[07:12]
for Reverb.
[07:13]
This means you can use MySQL or
[07:16]
PostgreSQL instead of Redis.
[07:19]
So, we don't want to do anything. Just
[07:20]
you see, before Redis, after Redis.
[07:23]
So, there is a scaling inside we have
[07:25]
driver property, there you set Redis.
[07:27]
Now, you can see in the after Laravel
[07:30]
drive after Laravel 13 database driver,
[07:32]
if you can see the section,
[07:34]
driver is database.
[07:37]
What is the database you are working
[07:38]
with? The database it will connect
[07:39]
automatically.
[07:41]
So, we don't want to do anything. You
[07:43]
only need to change one config value
[07:45]
from the Redis to database, that's all.
[07:47]
Which one you are using by default, it
[07:49]
will continue with that. So, we don't
[07:51]
want to work hard here. So, for this
[07:54]
especially for the Reverb database, this
[07:56]
is a very nice fix coming from the
[07:58]
Laravel.
[08:01]
So, this is why this is helpful means,
[08:03]
no need to install Redis in smaller
[08:05]
projects.
[08:06]
Easier to set up and manage. You can use
[08:09]
your existing database. No need to go
[08:12]
for any other. Good enough for many
[08:15]
Laravel applications. For very large
[08:17]
apps, still Redis is faster.
[08:20]
But, for most projects,
[08:22]
the new database driver is great option.
[08:25]
Let's talk about the next feature, that
[08:26]
is nothing but a passkey authentication.
[08:30]
Laravel 13 is now support passkey
[08:32]
authentication directly
[08:34]
in starter kits
[08:36]
and a Fortify.
[08:38]
Earlier, we have to take some
[08:40]
third-party libraries help to do this,
[08:43]
but now we don't want to go for any
[08:45]
third-party.
[08:46]
So, it is available inside Laravel
[08:49]
itself directly. What are the passkeys?
[08:51]
Let me explain you. Passkeys are a
[08:54]
modern replacement of passwords.
[08:56]
Generally, we will type the passwords.
[08:58]
Instead of typing passwords, user can
[09:01]
log in using Face ID, fingerprint,
[09:04]
Windows Hello, hardware security keys
[09:06]
also.
[09:08]
Definitely, this is going to be more
[09:10]
useful. Why this is more useful?
[09:12]
Biometric login works out of the box.
[09:15]
Hardware keys are also supported. No
[09:18]
extra packages are required. That is
[09:20]
very important. Passkeys use public key
[09:23]
security.
[09:25]
The public key is stored on server,
[09:27]
but the private key stays safely on
[09:31]
user's device.
[09:33]
This makes login more secure and
[09:35]
protects the
[09:37]
protects it against the phishing
[09:38]
phishing techniques and everything,
[09:40]
whatever it is.
[09:43]
One of the powerful mechanism that is
[09:44]
passkey authentication. You believe me
[09:47]
or not, recently, I have implemented
[09:49]
passkey authentication for iPhone
[09:52]
uh in one of my projects.
[09:54]
So, people are slowly the people are
[09:55]
asking these features. That's why these
[09:58]
people also introduced this
[09:59]
authentication. The next new feature is
[10:02]
cache and queue enhancements. What is
[10:04]
this? Laravel 13 introduced there is a
[10:07]
method called cache a touch.
[10:09]
It lets you to extend the cache expiry
[10:12]
time without reloading or changing the
[10:15]
cache data.
[10:16]
You see that powerful feature. But
[10:18]
earlier what is happening? If you wanted
[10:21]
to keep cache data alive, you had to
[10:24]
reload and save it again.
[10:26]
Or let it expire.
[10:28]
Now you can simply update the TTL for
[10:31]
the same cache key.
[10:34]
This is useful for active users session
[10:37]
like caching and keeping frequently used
[10:40]
data fresh.
[10:42]
The next feature.
[10:44]
JSON API resources and security. What
[10:48]
exactly this is? Simply says Laravel 13
[10:50]
has a built-in JSON API resource
[10:53]
support. We don't want to go for any
[10:55]
third party again. It automatically
[10:57]
handles the correct formatting, field
[11:00]
selection, relationships, and headers
[11:02]
and everything.
[11:03]
No need for extra packages or manual
[11:06]
setup to work with this JSON API in
[11:08]
future. In Laravel 13 specially.
[11:10]
CSRF protection is improved provided a
[11:13]
middleware
[11:14]
to improve the CSRF protection. The
[11:17]
middleware name is prevent request
[11:19]
forgery.
[11:20]
We can check this also. It checks both
[11:23]
the token and the request origin for
[11:26]
better security. Next one.
[11:28]
Teams, bug fixes, and other additions.
[11:31]
Laravel 13 brings back the teams
[11:33]
feature. It is back with a better
[11:36]
structure.
[11:37]
This helps you to build apps with the
[11:40]
multiple teams, user management, roles
[11:43]
and permissions, and the team switching.
[11:46]
This is a very useful SaaS application.
[11:49]
Laravel 13 fixes an important MySQL
[11:52]
issue.
[11:53]
Before
[11:54]
if you use a delete with join
[11:57]
the order by and limit options are
[12:00]
ignored.
[12:02]
Because of this, Laravel could delete
[12:04]
all matching records instead of only the
[12:07]
required few.
[12:09]
Now this problem is fixed. Still after
[12:12]
upgrading, test your delete queries
[12:14]
carefully.
[12:16]
STR factory reset test. This is also an
[12:20]
issue and it is also fixed in Laravel
[12:21]
13.
[12:23]
Before, if one test changed the STR
[12:26]
factory behavior, that change could
[12:29]
affect other tests also. And create
[12:32]
confusing errors. Now Laravel reset it
[12:35]
automatically after each test.
[12:39]
Next one more thing. Semantic vector
[12:41]
search. In Laravel 13 adds where vector
[12:45]
similar to method
[12:47]
to the query builder.
[12:49]
This allows semantic search with
[12:52]
PostgreSQL
[12:53]
and PG vector.
[12:55]
It is useful for AI features like
[12:58]
embedding base search.
[13:01]
Next one. The verification email
[13:04]
improvements.
[13:06]
Laravel 13 also improves the subject
[13:09]
lines of verification emails and
[13:11]
password reset emails.
[13:14]
They now follow modern email
[13:16]
capitalization style. It is a small
[13:19]
change, but it makes Laravel looks more
[13:22]
polished really.
[13:25]
Now let us talk about what was dropped
[13:28]
in Laravel. I mean what is removed.
[13:31]
Right? What are the breaking changes?
[13:33]
And let us see. PHP 8.0 is removed for
[13:36]
the support. Definitely you have to go
[13:37]
8.3 or higher. Verify CSRF token has
[13:41]
been replaced with the prevent request
[13:43]
forgery.
[13:45]
Laravel 13 makes small changes to how
[13:48]
some cache data is stored. But most apps
[13:52]
will not notice this. But if you cache a
[13:55]
complex object, test carefully. Cache
[13:57]
session naming defaults and name
[14:00]
arguments stability removed. Now the
[14:04]
next one is going to be upgrading
[14:06]
to Laravel 13. So most of the Laravel
[14:10]
apps now 12.
[14:13]
So how we can upgrade this?
[14:16]
First make sure your project is using
[14:18]
8.3 version or higher. So find the PHP
[14:21]
version by using PHP hyphen V.
[14:24]
You'll get the latest version. As well
[14:26]
as update the composer.json. So in that
[14:28]
composer.json we have version with caps
[14:30]
12.0. Just change this to cap 13.0 and
[14:33]
run composer update. Just if you can run
[14:36]
composer composer update Laravel
[14:37]
framework, it will
[14:39]
take the latest version of the Laravel.
[14:41]
Also review the custom CSRF middleware
[14:45]
if it is added in it.
[14:49]
So test on staging. Definitely you have
[14:51]
to test the application and use Laravel
[14:54]
Shift. That is optional for bigger
[14:56]
projects you can use Laravel Shift. It
[14:58]
helps you to automate the upgrade.
[15:01]
And creates a pull request with
[15:03]
suggested changes actually. That's the
[15:05]
best option. Look at the key takeaways.
[15:08]
There is no breaking changes. 8.3 is
[15:10]
required.
[15:12]
PHP attribute that is a new feature
[15:13]
implemented. Now the support is
[15:16]
available implemented in Laravel 13.
[15:18]
Laravel AI SDK. One of the powerful new
[15:22]
feature is also added. And passkey
[15:24]
authentication.
[15:26]
Reverb can now use MySQL PostgreSQL
[15:30]
instead of Redis. Laravel 13 brings many
[15:34]
useful improvements and makes
[15:36]
development even better.
[15:38]
Yeah, this is all about Laravel 13
[15:40]
updates. You can also check the official
[15:42]
Laravel 13 docs and upgrade guide.
[15:46]
Let me know in the comment section which
[15:48]
Laravel 13 feature do you like the most?
[15:52]
Yeah. If this video is helpful to you,
[15:55]
please like and subscribe.
[15:57]
See you in the next video. Thank you.