Latest Features of Laravel You Would Want to Try
Features of Laravel 5.8
For the development of custom software, Laravel is the favorite PHP framework of many professionals. Laravel makes it very easy for the user to provide clean and user-friendly API and implement authentication.
This framework keeps releasing updates at 6-month intervals to fix the issues and increase efficiency. The latest version was released on 26th February 2019.
Let us go through the interesting features that Laravel 5.8 has in store for us:
Mock & Spy Methods
These methods naturally bind the ‘mocked’ class into the container which allows the users to create more clean codes. These have been included in the ‘mock” and ‘spy” methods in the base Laravel test case class.
Most of the users are unaware of the fact that it is not always important to use the Laravel Passport for API authentication. The basic API authentication is provided by the user-friendly ‘token guard’. This is the facility that is available in earlier versions.
However, Laravel 5.8 comes with advanced features. This version provides support for storing the tokens as SHA-256 hashes. Thus, this feature provides a higher level of security while securing the tokens.
Laravel 5.8 includes a new Date façade along with a Carbonlmmutable class. It enables a user to make a copy of the original datum and also to modify the copy without changing the original datum. It is also possible to use this feature via the App Service provider. Thus, it makes easier for the professionals to work with time and date.
Automatic Policy Resolution
With the release of this version, it is not important to manually register the policies in Auth Service Provider. This framework can naturally discover the policies. It is very essential for this feature to function that ‘policy directory’ has to be in the default location.
Cache TTL Modification
Earlier the caching was set in minutes. This new version enables a setting of expiration time at the time of the storage of items. Thus, in this version, the caching is set in seconds.
This modification is simple yet is very important as it offers compliance with PSR-16 caching library standards.
Improvement of Artisan Serve
This version brings advancement to Laravel’s CLI tool. The new feature enables us to serve more than one Laravel application at once, by using all the available ports between 8000-8009.
Inclusion of has one through Relationship
By including this feature in Laravel 5.8, the efficiency of the tasks of web artisans has increased. This feature already exists in the Rails framework.
Improvement of Artisan Call
This version has enabled a user to make the ‘artisan’ commands from the code which utilizes the ‘Artisan:: call’ method. The users can pass the options in one string instead of passing the options as an array that was applicable in previous versions.
‘Higher Order’ or ‘Where Method’
Earlier it was necessary to use the ‘or’ query in order to mix the model scopes. Now with this version, a ‘closure’ callback has been necessitated.
This version has a ‘where’ method or a ‘higher-order’ method which allows the user to put the ‘scopes’ together without making the use of closures.
Scheduler Timezone Configuration
Earlier, if a user had to define the timezone then he had to repeat the ‘timezone’ method for each scheduled task. This version sets you free from this tiresome process. In this one may define the ‘schedule timezone’ method in the ‘app/console/kernel.php file’ and return back to the default timezone.
So these are new and advanced features that Laravel 5.8 has for us in store. These features not only make the developer’s work easy but also saves time and energy.
After reading this, we are sure you must be eager to know more about web development, app development and about Laravel. So you can visit our previous blogs for the same.
HAPPY CODING!! ( web development company in Jaipur)