What's New in Laravel 5.3


0   0

What's New in Laravel 5.3

It's about that time again! The release of Laravel 5.3 is imminent. That means, it's finally time to dig in and see what's new. And, well, there's a lot! From directory changes, to notifications, to passports, to everything in between!

Lets checkout what's new in Laravel 5.3

1. Important Directory Changes
To begin you'll notice that your main directory structure is slightly different!

2. The Query Builder Now Returns Collections
As of 5.3, all query builder calls will return collection objects, rather than arrays. If you think about it, this will make the general Laravel API more consistent, as relevant Eloquent calls already return collection objects.

3. The Global Cache Helper

4. The JavaScript Suggestion
The framework makes a light suggestion on a practical JavaScript setup, using Vue. Have a look at your resources/assets/js folder to check it out.

5. Simpler Pagination
Out of the box in Laravel 5.3, pagination will still feel very similar to you. However, should you need to modify the underlying HTML, the process is now significantly easier. In fact, you'll find that the process is very similar to how it was in Laravel 3!

6. Mailables
"mailables" are thin wrappers around the traditional syntax for sending mail. I think you'll find that they're easier to work with, and much easier on the eyes.

7. Foreach, and the Loop Object
This next addition is a small, but useful one. When using the foreach or for else Blade directives, you'll now have a new $loop object available to each iteration. This will provide useful information about the loop, including the current index, if it's the first or last item, if there are remaining iterations for the loop, and more.

8. Toggle Pivot Table Records
You'll find a new toggle() method on all belongsToMany relationships. This solves the issue of needing to delete a pivot table record if it exists, or adding it if it doesn't. As an example, consider needing to toggle a user's "like" status for a post.

9. Notifications: Email
Notifications in Laravel 5.3 are incredible. Create a single notification class, and then designate one or more distribution channels to use - such as email, SMS, Slack, and more.

10. Notifications: Database
Let's move on and review the database channel for sending notifications. With this approach, any notification you send will be stored in the database, at which point you can fetch them and display them for the user.

11. Send Slack Notifications With Laravel in Minutes
Let's learn how to use Laravel 5.3's Slack notification channel to notify us, the administrator, each time a payment is processed in our application. As you'll quickly see, it's all a cinch!

12. Super Simple File Uploading
Admit it: you always have to do a bit of research to remind yourself how to upload files, determine the temporary folder, guess the file extension, etc. Well now, I promise: you won't forget. In Laravel 5.3, the UploadedFile instance offers a new store() method for rapidly saving files - even all the way to S3 (as we'll do in this video).

13. Laravel Passport
Want to setup an OAuth2 server with API authentication in minutes, instead of days? Well, you're in luck. Laravel Passport has your back!

14. Closure-Based Commands
Closure-based commands are a useful alternative to generating full Artisan command classes. You'll find that this approach is quite similar to how you do your routing (closures vs. controller classes). Want to pass a simple closure to handle a command? Well now you can!

15. Advanced Search With Laravel Scout
Laravel Scout is a driver-based solution for performing advanced, full text search on your Eloquent models. Out of the box, it comes with support for Algolia, which offers a fantastic service. In this episode, we'll learn how to set everything up, and send a table full of records to Algolia.

17. Facade Fakes
In Laravel 5.3, a number of facades provide a static fake method that can be called to replace the underlying class with a minimal fake version, for the purposes of testing. A fake is a type of test double, where you create a light, barebones implementation of a particular API or interface in order to satisfy or assist a given test.

Consider a scenario where the code you're testing fires an event. Well, it's possible that you don't want the associated event listeners to be triggered, as part of that test. Instead, we can use a double: replace the underlying event dispatcher with a fake version.

Please Like, Share, Comment and Subscribe for more videos and updates

View More