See rates for the top Laravel developers in Latin America

Laravel 5.6.12 Released

Published on by

Laravel 5.6.12 Released image

Laravel 5.6.12 shipped over the weekend with added support for signed routes and URLs along with quite a few other new additions.

Support for signed routes was added by Taylor Otwell, which provides a few new methods you can use to generate a signed route and a temporary signed route. For example, if you have a named route foo, you can generate a temporary URL. The following snippet comes from the pull request tests:

Route::get('/foo/{id}', function (Request $request, $id) {
return $request->hasValidSignature() ? 'valid' : 'invalid';
})->name('foo');
 
URL::temporarySignedRoute('foo', now()->addMinutes(5), ['id' => 1]);

The signed routes come with a new ValidateSignature middleware that will throw an InvalidSignatureException if the route signature is tampered with or expires, which results in a 401 status code.

Two new query builder methods were added, fromSub() and fromRaw() that help you create a subquery on from, instead of only being able to use table names.

Next up, is a new “not regex” validation rule that validates that an attribute doesn’t pass a regular expression check.

An “after” callback was added for model factories that allow a user to define an action to be run after the model is created or made using create() or make().

A new “any filled” conditional was added to the request used to determine if any of a group of inputs is filled on the request. Before Laravel 5.6.12, you would do something like this:

if ($request->filled('disk') || $request->filled('site')) {
//
}

Now, it can be changed to use the new method conditional, which will accept an array of inputs or any number of arguments:

if ($request->filledAny(['disk', 'site'])) {
//
}
 
// Or
 
if ($request->filledAny('disk', 'site')) {
//
}

Two new assertions were added to the TestResponse class, assertNotFound() and assertForbidden(). These methods are used to assert a 404 status code and a 403 status code respectively.

Last up test helpers were added to assert that a job is queued with a chain.

Here’s the full release notes from the Laravel 5.6 changelog:

v5.6.12 (2018-03-14)

Added

  • Added fromSub() and fromRaw() methods to query builder (#23476)
  • Added “Not Regex” validation rule (#23475)
  • Added seed parameter to Arr::shuffle() (#23490)
  • Added after callback to model factories (#23495, d79509d)
  • Added Request::anyFilled() method (#23499, 896d817)
  • Added support for signed routes (#23519)
  • Added assertNotFound() and assertForbidden() methods to TestResponse (#23526)
  • Added test helpers to assert that a job has been queued with a chain (#23531, 696f4d8)

Changed

  • Only set id on NotificationFake if there is no id set (#23470)
  • Check whether fetch() method exists in Application::output() (#23471)
  • Improve asset loading in app.stub (#23479)
  • Support ignoring a model during a unique validation check (#23524)
  • Support multiple model observers (#23507)
  • LogManager driver capable of producing logger with any Monolog handler (#23527, d499617)
  • Support passing model instance to updateExistingPivot() (#23535)
  • Allow for custom TokenGuard fields (#23542)

Fixed

  • Fixed clearing the cache without a cache directory (#23538)
Paul Redmond photo

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

Cube

Laravel Newsletter

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

image
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 more

Visit CodeRabbit
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
NativePHP logo

NativePHP

Build rich mobile apps across iOS and Android from a single Laravel codebase. This changes everything!

NativePHP
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

The latest

View all →
Manage Taxonomies, Categories, and Tags in Laravel image

Manage Taxonomies, Categories, and Tags in Laravel

Read article
Extract Arrays from Any Data Type with Laravel's Arr::from Method image

Extract Arrays from Any Data Type with Laravel's Arr::from Method

Read article
Better defaults for your Laravel applications with Essentials image

Better defaults for your Laravel applications with Essentials

Read article
Repeat Strings Efficiently with Laravel's Str::repeat Method image

Repeat Strings Efficiently with Laravel's Str::repeat Method

Read article
Encrypt and Decrypt String Helpers in Laravel 12.18 image

Encrypt and Decrypt String Helpers in Laravel 12.18

Read article
Keep Your Place: Enhancing User Experience with Fragment Method image

Keep Your Place: Enhancing User Experience with Fragment Method

Read article