Laravel 5.6.14 Released

Published on by

Laravel 5.6.14 Released image

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 // null
optional($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() and max() 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 in Application::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 from 401 to 403 (#23662, c99911f)

Fixed

  • Revered breaking changes in ManagesLoops (d0a2613)
  • Set exit status in serve command (#23689)
Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Filed in:
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Bacancy

Outsource a dedicated Laravel developer for $2,500/month. With over a decade of experience in Laravel development, we deliver fast, high-quality, and cost-effective solutions at affordable rates.

Visit Bacancy
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Join the Mastering Laravel community logo

Join the Mastering Laravel community

Connect with experienced developers in a friendly, noise-free environment. Get insights, share ideas, and find support for your coding challenges. Join us today and elevate your Laravel skills!

Join the Mastering Laravel community
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Enhance Validation Testing Precision with Laravel's assertOnlyJsonValidationErrors image

Enhance Validation Testing Precision with Laravel's assertOnlyJsonValidationErrors

Read article
Generate HTTP Fixtures from Live API Calls in Laravel image

Generate HTTP Fixtures from Live API Calls in Laravel

Read article
Confidently Extract Single Array Items with Laravel's Arr::sole() Method image

Confidently Extract Single Array Items with Laravel's Arr::sole() Method

Read article
Safely Retry API calls in Laravel image

Safely Retry API calls in Laravel

Read article
Laravel's AsHtmlString Cast for Elegant HTML Attribute Management image

Laravel's AsHtmlString Cast for Elegant HTML Attribute Management

Read article
NativePHP for Mobile v1 — Launching May 2 image

NativePHP for Mobile v1 — Launching May 2

Read article