Here we are… This is the last article about Laravel 9!
In this episode we are looking at some tiny but useful features of Laravel 9.
1. server.php file: You can get rid of it!
Until this version of Laravel, we had a server.php
file inside the framework root directory that allows us to emulate Apache’s mod_rewrite functionality from the built-in PHP web server.
This provides a convenient way to test a Laravel application without having installed a “real” web server software here. OK, I know! Let’s crack it down to simple words: actually php artisan serve
will use this file to serve your website!
And Here is the magic, in Laravel 9 we can remove it for good and there is no problem with this action because it will be included inside the framework.
2. Full Text Indexes
Laravel 9 will support full-text indexes which will provide for us where clause method that we can use in our queries for text columns of MySQL or PostgreSQL tables. Laravel will automatically transform these methods to raw SQL. e.g:
- generate full-text indexes for our table column(in migrations):
-
whereFullText()
method:
3. Controller Route Groups
We can now use the controller()
method to define the common controller for all of the routes within the same controller. e.g:
So we will define any route to in the UserController
to invoke the related method like above.
4. SwiftMailer is a goner!
Previous versions of Laravel used the Swift Mailer library to send outgoing email. But, mentioned library is no longer maintained and has been succeeded by Symfony Mailer.
We can read the upgrade guide to find out our application is compatible with Symfony Mailer.
Top comments (0)