[00:00]
Laravel 13 is finally here, but this is
[00:03]
not our typical Laravel release because
[00:06]
in this upgrade there is no massive
[00:09]
breaking changes, no big a structural
[00:11]
shift like Laravel 11, but still some
[00:15]
very important improvements that can
[00:17]
impact your real world applications. Hi
[00:20]
everyone, this is Umesh Rana and welcome
[00:23]
back to Programming Fields where we
[00:25]
focus on building real world production
[00:27]
ready applications using modern
[00:29]
technologies like Laravel and React.
[00:32]
In this video, I will explain Laravel 13
[00:36]
in a very simple and practical way. So,
[00:38]
even if you are new to these features,
[00:41]
you will clearly understand what is new,
[00:44]
why it matters, and where you can use
[00:47]
it. And if you're serious about becoming
[00:49]
a better developer, make sure to
[00:51]
subscribe to Programming Fields and hit
[00:53]
the bell icon because this is just the
[00:56]
beginning of our Laravel 13 deep dive
[00:59]
series. And in this video, we will go
[01:01]
step-by-step starting from what Laravel
[01:04]
13 is, then moving into features, and
[01:07]
finally understanding whether you should
[01:09]
upgrade or not. And before we jump into
[01:12]
the details, let's quickly look at what
[01:14]
we're going to cover in this video.
[01:16]
First, we will understand what Laravel
[01:18]
13 is and what type of release this is.
[01:21]
Then we will look at the breaking
[01:23]
changes. After that, we will go through
[01:25]
all the important new features with
[01:27]
examples, and finally, we will discuss
[01:30]
whether you should upgrade your Laravel
[01:32]
version or not.
[01:33]
So, make sure you watch till the end,
[01:35]
especially if you are planning to
[01:37]
upgrade your project. So, we will start
[01:40]
from what is Laravel 13.
[01:42]
So, Laravel 13 is not about big changes.
[01:46]
It is about making Laravel better and
[01:48]
more future ready.
[01:51]
And you can think of it like improving
[01:53]
what already works well. So, if you are
[01:55]
expecting a big rewrite, this is not
[01:58]
that release. And this release primarily
[02:01]
focuses on the performance improvements
[02:04]
and future ready for AI and modern PHP
[02:07]
development.
[02:08]
Now, we will talk about breaking change.
[02:11]
So, in Laravel 13, this does not support
[02:14]
PHP 8.2. And as per the official
[02:17]
documentation, Laravel 13 supports
[02:19]
minimum version of PHP 8.3. So, this is
[02:23]
the only important breaking change.
[02:25]
Laravel 13 requires PHP 8.3 because
[02:29]
Laravel can now use modern PHP features
[02:33]
which improve performance and code
[02:35]
quality.
[02:36]
So, before upgrading, make sure your
[02:39]
system supports PHP 8.3 version.
[02:42]
Now, we will talk about very first
[02:44]
feature of Laravel 13, which is PHP
[02:47]
attributes. So, the PHP attributes is a
[02:50]
modern PHP feature which provides a
[02:53]
cleaner alternative to properties or
[02:56]
configuration in classes. And in
[02:59]
Laravel, we can use it in every classes
[03:02]
like jobs, models, controllers,
[03:05]
commands, notifications, etc. So, we
[03:08]
will see this syntax using examples. So,
[03:11]
here in the first example, we are
[03:13]
applying rate limiting directly to a
[03:16]
method inside controller.
[03:18]
And this keeps everything clean,
[03:20]
organized, and easy to read.
[03:23]
Previously, we had to define this
[03:25]
throttle in the routing, right? Now, if
[03:28]
you'll take a look to the second
[03:30]
example, this is a model class.
[03:32]
So, here in previous versions of
[03:34]
Laravel, we had to define the fillable
[03:37]
property, hidden property, or even table
[03:41]
name. We had to define it using this
[03:43]
access a specifier as protected, right?
[03:46]
Now, in Laravel 13, here in the model
[03:50]
itself, we can define the fillable
[03:52]
property, table name, and even we can
[03:56]
type cast the fields using attributes
[03:58]
itself. Now, in the third example, we
[04:01]
can apply this attribute in the
[04:03]
validation as well.
[04:05]
So, instead of writing validation rules
[04:07]
in arrays format, you can define them
[04:10]
directly using attributes in this way.
[04:13]
And if you are familiar with Livewire,
[04:16]
then Livewire 3 was following the same
[04:18]
approach. So, the benefits of using
[04:20]
attribute is this provides cleaner
[04:23]
structure, easy to understand, and less
[04:26]
boilerplate code. And these are examples
[04:29]
to help you understand how attributes
[04:31]
work conceptually in Laravel 13.
[04:34]
But don't worry if this feels new, we
[04:37]
will cover attributes in detail in a
[04:39]
dedicated video with real projects.
[04:42]
Now, we will jump to the next feature,
[04:44]
which is cache touch function.
[04:47]
So, let's understand this using this
[04:49]
example.
[04:50]
So, let's say you have stored user data
[04:53]
in cache for 10 minutes. Normally, after
[04:57]
expiry, you need to fetch data again
[05:00]
from database in order to set into the
[05:03]
cache. But with cache touch function,
[05:06]
you can extend the cache time without
[05:08]
fetching data again from the database.
[05:12]
So, why this is useful? Because this
[05:14]
will reduce the database query. So, now
[05:18]
when the cache will expire, you don't
[05:20]
need to fetch that data from the
[05:22]
database again. Instead, you can extend
[05:25]
the cache expiry time without fetching
[05:27]
it from the database.
[05:30]
Next, this will improve the performance
[05:32]
and saves server resources. All right.
[05:36]
So, if a user is active, you can keep
[05:38]
extending cache instead of reloading
[05:42]
data.
[05:43]
Now, we will jump to the next feature,
[05:45]
which is AI integration. So, Laravel 13
[05:48]
introduces official support for AI.
[05:52]
Now, you can build intelligent features
[05:55]
like chatbots, a smart search systems,
[05:58]
recommendation engines, and this is
[06:01]
optional. So, Laravel is not forcing to
[06:04]
use AI, but it is uh preparing for the
[06:07]
future. And we will cover this in a
[06:10]
detail in a separate video. Now, next
[06:12]
feature we have passkeys. So, passkeys
[06:15]
allow users to log in without passwords.
[06:19]
Instead, they use Face ID, fingerprint,
[06:23]
and device authentication.
[06:25]
And the benefits of using the passkeys
[06:28]
for the authentication is this provides
[06:30]
better security and better user
[06:33]
experience. And this is already being
[06:35]
used in modern applications.
[06:38]
In previous version of Laravel, that
[06:40]
means in Laravel 12, we had to use a
[06:43]
third-party library as WebAuthn
[06:46]
authentication for handling this
[06:48]
passkeys authentication, right?
[06:51]
But in Laravel 13, this supports
[06:53]
internally. So, we will see that in the
[06:56]
practical way. Now, we will jump to the
[06:58]
next feature.
[07:00]
We have Reverb driver.
[07:03]
So, earlier for WebSockets, you needed
[07:06]
Redis. Now, Laravel allows you to use
[07:09]
database instead. So, why this matters?
[07:12]
Because this provides easier setup,
[07:15]
lower cost, and good for small projects.
[07:19]
Next, we will talk about the JSON API
[07:21]
response. So, Laravel improves JSON API
[07:25]
responses. And this is very important
[07:28]
for front end because front end gets
[07:31]
consistent data from the back end using
[07:33]
API response.
[07:35]
And this will be easy to maintain.
[07:37]
Especially, this is useful if you are
[07:40]
working with React or mobile
[07:42]
applications. Now we will talk about the
[07:44]
improvements in Laravel 13. So in
[07:47]
Laravel 13, this improved queue
[07:49]
handling, faster performance, cleaner
[07:52]
code base, and updated a few
[07:54]
dependencies internally.
[07:56]
So these improvements may not look big,
[07:59]
but they are very important in
[08:01]
real-world applications. They make your
[08:03]
applications faster, more stable, and
[08:06]
easier to maintain.
[08:08]
Now we will talk about the deprecation
[08:10]
in Laravel 13.
[08:12]
So Laravel 13 does not remove many
[08:15]
features. The only major change is
[08:17]
dropping PHP 8.2 support.
[08:20]
So upgrading is relatively safe. So in
[08:24]
Laravel 13, we will have to use at least
[08:26]
PHP 8.3. Now last but not least, we will
[08:31]
discuss about should you upgrade from
[08:33]
previous version to Laravel 13? So the
[08:36]
answer is if you are starting a new
[08:38]
project, go with Laravel 13, which is a
[08:41]
latest version. But if your project is
[08:44]
already stable, you can upgrade later.
[08:47]
And if you are on PHP 8.2, you will have
[08:50]
to upgrade PHP version first. So that's
[08:53]
a complete and simple explanation of
[08:55]
Laravel 13. In the next video, we will
[08:58]
install Laravel 13 step-by-step and
[09:00]
understand the project structure in
[09:02]
detail.
[09:03]
And in this series, we will also build
[09:05]
real-world applications using Laravel
[09:07]
13. So if you don't want to miss that,
[09:10]
make sure to subscribe to Programming
[09:12]
Fields and hit the bell icon. And let me
[09:14]
know in the comments, are you planning
[09:16]
to upgrade to Laravel 13 or not? So once
[09:19]
again, thanks for watching and I will
[09:20]
see you in the next video.