This is the sixth day of my participation in the August Text Challenge.More challenges in August
Before, I wrote an article about Laravel improving the efficiency of DB query. After forwarding it to the group, some people questioned me and said, “Laravel is the framework he used several years ago, I didn’t expect that there are still people using it now.”
Nani, what do you mean? Don’t forget PHP is the best language!
Personally, Laravel is a very elegant development framework: elegant design patterns, powerful feature implementations, easy extensions, constant release updates, and most importantly, the best technology development community to date, in my opinion.
I have to make a Call for Laravel.
Laravel released version 8.0 on September 8, 2020. Laravel is scheduled to release version 9.0 on January 25, 2022.
Here I would like to introduce the new features of the latest Laravel release (8.0) :
Laravel 8 with the introduction of Laravel Jetstream, model factory classes, Migration compression, queue batching, improved rate limiting, queue improvements, dynamic Blade components, Tailwind paging view, Time test Assistant, artisan Serve improvements, Improvements to the event listener, along with various other bug fixes and usability improvements, continue to improve Laravel 7.x.
Today highlights Artisan Serve improvements, Tailwind paging view, and routing namespace updates.
Artisan serve to improve
The Artisan Serve command automatically reloads when environment variables are detected in the local. Env file. Previously, this command had to be manually stopped and restarted.
Tailwind paging view
The Laravel pager has been updated to use the Tailwind CSS framework by default. Tailwind CSS is a highly customizable low-level CSS framework that gives you all the building blocks you need to build custom designs without you having to worry about rewriting any annoyingly self-righteous styles. Of course, Bootstrap 3 and 4 views are still available.
Route namespace update
In earlier versions of Laravel, the RouteServiceProvider had the $namespace attribute. The value of this property is automatically added to the prefix in the controller route definition and the action helper function or URL::action method is called. In Laravel 8.x, this property is null by default. This means that Laravel does not automatically name space prefixes. Therefore, in the new Laravel 8.x application, controller routing should be defined using standard PHP syntax:
use App\Http\Controllers\UserController;
Route::get('/users', [UserController::class, 'index']);
Copy the code
Calls to action-related methods should use the same invocation syntax:
action([UserController::class, 'index']);
return Redirect::action([UserController::class, 'index']);
Copy the code
If you prefer the Laravel 7.x route prefix for controllers, you can simply add the $Namespace attribute to your application’s RouteServiceProvider.
Gorgeous dividing line
For more on Laravel, check out my column: Server Development from Beginner to Master
Recommended reading
-
I’m still working on Laravel? Don’t forget PHP is the best language. (1) How does Laravel elegantly set global variables
-
I’m still working on Laravel? Don’t forget PHP is the best language. (2) Laravel Jetstream and model Factory classes
-
I’m still working on Laravel? Don’t forget PHP is the best language. (3) Migration compression, queue batch processing, improve rate limit
-
I’m still working on Laravel? Don’t forget PHP is the best language. (4) Optimization of maintenance mode
-
# Is there any question that I’m still developing with Laravel? Don’t forget PHP is the best language. (5) Dynamic Blade event listener optimizes event test assistant
Last but not least
Technical group please come here. Or add my wechat account wangzhongyang0601 to learn together.