The first stop on our Laravel 6 tour is lazy collections, contributed by Joseph Silber. This is easily one of my favorite additions to Laravel 6. While a traditional
Collection wraps an array, a
LazyCollection leverages generators to significantly reduce memory consumption issues, while still offering the same elegant chaining that you've become accustomed to.
When installing a fresh Laravel 6 application, you'll notice that the login and registration scaffolding, as well as the Vue/jQuery/Bootstrap boilerplate in your
app.js file have been extracted to a new Composer package:
laravel/ui. This helps to clean up the default install, while allowing the package to be versioned separately from the framework.
Laravel 6 ships with improved support for Eloquent subqueries, thanks to a few PRs from Jonathan Reinink. You may now add subqueries by using the new
addSelect() method, or by passing a closure to the
from() methods of the query builder. I'll show you how in this lesson.
*Series still in development. Check back often for updates.