Laravel 6.5 Is Now Available
The Laravel team released v6.5 this week with a new remember function added to the LazyCollection. Also, this release includes a few new string helpers, custom unless blade conditions, and a few new query builder methods.
First, a new LazyCollection::remember() method which remembers any enumerated values and will not pull them from source when enumerated again. Here’s an example from the pull request:
Here’s an example from the PR’s tests, which might be a little simpler to understand:
Next, two new Str methods were added: afterLast() and beforeLast():
Next, the query builder now has existsOr and doesntExistOr methods, which allow you to define a callback when the condition is false:
Last, new unless conditions are added to custom Blade if directives. For example, a custom env example from the Blade documentation allows you to use this syntax in Blade:
Now you can additionally use the “unless” variant of this condition to avoid weird if/else scenarios:
You can see the full list of new features and updates below, and the whole diff between 6.4.1 and 6.5.0 on GitHub. The full release notes for Laravel 6.0 are available in the GitHub v6 changelog
