Laravel 5.6.14 Released
Published on by Paul Redmond
Two Laravel releases have shipped this week: Laravel 5.6.13, released Monday, and Laravel 5.6.14, released on Wednesday. The highlight of these releases for me is the new view:cache
artisan command and a few new higher order proxies on the collection class.
New Updates in 5.6.14
Laravel 5.6.14 adds SessionGuard::logoutOtherDevices()
which invalidates other sessions for the current user. The application must be using the AuthenticateSession
middleware.
A SlackMessage::info()
method was added. SlackMessage’s default level is info
, but this method allows you to be explicit about it.
Various templates and stubs replaced or
with the null coalesce operator. If you want more info on removing or
in Laravel 5.7, we wrote about updating your blade templates to use the null coalesce operator ahead of time.
New Updates in 5.6.13
I am extremely excited about the new view:cache
command added that caches your blade templates, efficiently allowing you the “warm” your template cache during a deploy, for example!
You can update your deployments to run artisan view:cache
to preemptively prime your cache instead of cache happening on-the-fly.
The min()
and max()
are now higher order proxies on collections:
$ tinker>>> $accounts = collect([... (object) ['balance' => 100],... (object) ['balance' => 200]... ]);>>> $accounts->max->balance=> 200
Two new blade directives, @elseauth
and @elseguest
were added:
@auth('administrator')@elseauth('standard')@endauth
The optional
helper now has callback support, which lets you pipe the value into an outside function, which also guarantees that you’re not passing the function null
. I think this change is explained clearly by looking at the test added with this new feature:
public function testOptionalWithCallback(){ $this->assertNull(optional(null, function () { throw new RuntimeException( 'The optional callback should not be called for null' ); })); $this->assertEquals(10, optional(5, function ($number) { return $number * 2; }));}
Using optional without a callback continues to work as usual:
optional($userNoAccount->account)->id // nulloptional($user->account)->id; // 2
Here’s the full release notes from the Laravel 5.6 changelog:
v5.6.14 (2018-03-28)
Added
- Added
SlackMessage::info()
method (#23711) - Added
SessionGuard::logoutOtherDevices()
method (9c51e49)
Changed
- Replaced Blade’s
or
operator with null-coalescing operator (13f732e)
Fixed
- Get Blade compiler from engine resolver (#23710)
- Default to an empty string when validating the URL signatures (#23721)
v5.6.13 (2018-03-26)
Added
- Added
view:cache
command (9fd1273, 2ab8acf) - Added
min()
andmax()
to as higher order proxies (#23560) - Added
@elseauth
and@elseguest
Blade directives (#23569) - Added support for hashing configuration (#23573, d6e3ca9)
- Allow tagged cache keys to be incremented/decremented (#23578)
- Added
SeeInOrder
constraint to avoid risky test notices (#23594, ca39449) - Support higher order
groupBy()
(#23608) - Support disabling setting
created_at
in models (#23667) - Added callback support to
optional()
helper (#23688) - Added
Eloquent\Collection::loadMorph()
method (#23626)
Changed
- Support generating a signed route with a
UrlRoutable
parameter (#23584) - Use
DIRECTORY_SEPARATOR
inApplication::environmentFilePath()
(#23596) - Support states on model factory after callbacks (#23551, #23676)
- Use
hash_equals()
for verifying URL signatures (#23618) - Refactored
Exceptions/Handler
(f9162c9, 6c5d971) - Changed status code of
InvalidSignatureException
from401
to403
(#23662, c99911f)