Advertisement

Main Ad

10 New Features of Laravel 8 in 2021


Laravel is a great open source program for engineers to build web apps.laravel Released in June 2011 and it's a free, open-source PHP web framework. the release of laravel 8.5 included some exciting updates.in this article we'll look at 12 of the best new features from the release.

1 APPS MODEL DIRECTORY
The artisan make model command will create the app's model directory if you don't like that it's possible to delete the app's models directory and artisan will create the model file in the app folder.

2 NEW LANDING PAGE
The new landing page includes light and dark mode capabilities and by default extends links to SAS products and community sites.

3 CONTROLLERS ROUTING NAME SPACING
No more double prefix issues. in previous versions of laravel the route service provider had an attribute called namespace that was used to prefix the controllers in the routes files that created a problem when you were trying to use a callable syntax on your controllers. causing laravel to mistakenly double prefix it for you this attribute was removed and now you can import and use it without the issue.

4 ROUTE CACHING
Laravel uses route caching to compile your routes. in a PHP array that's more efficient to deal with in laravel 8. it's possible to use this feature even if you have closures as actions to your routes this should extend the usage of route caching for improved performance.

5 ATTRIBUTES ON EXTENDED BLADE COMPONENTS
In laravel 7 the child components didn't have access to the attributes passed to it. in Laravel 8 these components have been enhanced and it's now possible to merge nested component attributes this makes it easier to create extended components.

6 BETTER SYNTAX FOR EVENT LISTENING
In the previous versions of laravel when creating a closure based event listener there was much repetition and a cumbersome syntax in laravel 8 it's simpler and cleaner.

7 QUEUEABLE ANONYMOUS EVENT LISTENERS
In Laravel 8 it's feasible to make queueable closure from any place in the code this will make a queue of anonymous event listeners that will get executed in the background.

8 MAINTENANCE MODE
This is especially useful when you need to take down your app for users to perform maintenance but still, need your developers to investigate bugs this will create a secret cookie that will be granted to whoever hits the correct endpoint allowing them to use the application in maintenance mode.

9 CLOSURE DISPATCH CATCH
Laravel has a lovely robust queue system that acknowledges a closure line that will get serialized and executed behind the scenes now we have an approach to deal with disappointments on the off chance that your work comes up short.

10 EXPONENTIAL BACK OFF STRATEGY
This is an algorithm that decreases the rate of your job in order to gradually find an acceptable rate now laravel has this capability to which is handy for jobs that deal with external APIs where you wouldn't want to try again in the same amount of time.

11 MODEL FACTORIES
model factories are class-based factories for each model, there's also a factory class where there's a definition method that says which attributes will generate for that model

12 LARAVEL JET STREAM
Laravel jet stream is the biggest feature added to version 8.5 it's a brand new scaffolding for laravel released as an open-source package jetstream offers a choice between livewire and inertia.js for scaffolding it builds an application using Tailwind CSS and tailwind UI includes login registration two-factor authentication session management.

there you have it the best new featuresin Laravel 8 have you tried any of them. let us know in the comments below you can also read more about Top Programming languages to learn for 2022 features right down bellow.

Post a Comment

0 Comments