Laravel, which is probably the single most popular PHP framework in use today, has just release a new version. Coming about 10 months after the previous 5.2, Laravel 5.3 has some pretty exciting new features. So let's have a look at some of them now.
- Laravel Notifications:
Laravel Notifications are handy because it allows you to easily send notifications through services like SMS, Slack and email. It ships with a handy view ready for you to use, also. Laravel Notifications are going to be useful for, say, when you update your site with new content. You can then easily email push a notification to everyone on Slack saying “Our site has been updated”, for example. Laravel Notifications are also Queueable, too.
- Laravel Passport:
Laravel Passport lets you setup your own OAuth2 server, Laravel passport ships using Vue.js. This is awesome news for all of you API developers out there. It’s worth noting that Laravel Passport is an optional package and you will need to do some configuring to set it up like configuring User to use the authentication time, changing the API guard to use the Passport driver and running all of the migrations.
- Laravel Scout:
Laravel Scout is an interesting one and I cannot wait to use it. In fact, we have the perfect client that we service already that I want to propose using Laravel Scout on. Laravel Scout is a full-text search for Eloquent and even more importantly, it’s driver based. This means that anyone in the Laravel community can write their own drivers for it to extend the functionality. Laravel Scout currently only supports Algolia but not to worry because people are already writing their own drivers for it. Laravel Scout works by simply adding a Searchable trait to your model and then syncing the data with the service using; php artisan scout:import App\\Model
- Routing changes:
Yup, there are routing changes to get used to in Laravel 5.3. But it’s for the good, so it doesn’t matter. I was expecting them to make this change at some point because it’s so much cleaner! The default routes file, app/Http/routes.php, no longer exists. It has been moved to the root directory inside of a new directory called routes (funny, that). From the get-go, you will notice 2 new route files; web.php and api.php. If you’re familiar with middleware, you’ll be right in thinking that the routes in web.php are wrapped in the web middleware group and the routes in api.php are wrapped in the api middleware group.
- Roll back:
Oh yes. You can now finally roll back a single migration with a single command.
php artisan migrate:rollback --step=1
- Query Builder
- Customizing pagination templates
- Image dimension validation rules
- New JSON-column where() and update() syntax
There are several other new features in Laravel 5.3, but I'll cut it here before I'm tempted to make more bad puns.
Hopefully this post gives you a brief idea of some of the new features that you can explore with Laravel 5.3 - See more at: //www.starkdigital.net/
Don’t forget, if you are looking for Laravel development, we are more than happy to help and you should contact us!
Sincere thanks to //laravel.com/docs/5.3/