Laravel 6.7.0 Released

Published on by

Laravel 6.7.0 Released image

The Laravel team released a minor version v6.7.0 this week, with the latest features, changes, and fixes for 6.x:

The HasTimestamps concern has two new methods to return the qualified columns for created and updated timestamp columns:

$model->getQualifiedCreatedAtColumn();
// i.e., users.created_at
 
$model->getQualifiedUpdatedAtColumn();
// i.e., users.updated_at

A new exceptionContext() method on the application’s Handler class provides additional custom logging context:

// App/Exceptions/Handler.php
protected function exceptionContext(Exception $e)
{
if ($e instanceof CustomException) {
return ['custom_context' => $e->getCustomProperty()];
}
 
return parent::exceptionContext($e);
}

The postmark transport will now throw errors instead of failing silently. Nothing needs to change in applications; by updating to the v6.7 release, you’ll get the benefit of exceptions when postmark doesn’t return a 200 status code.

An important withoutRelations() method is available on models now to allow unloading a model’s relations in a queue job:

Because loaded relationships also get serialized, the serialized job string can become quite large. To prevent relations from being serialized, you can call the withoutRelations method on the model when setting a property value. This method will return an instance of the model with no loaded relationships.

Here’s an example in a queue job constructor, which duplicates the model instance and unloads the relations:

/**
* Create a new job instance.
*
* @param \App\Podcast $podcast
* @return void
*/
public function __construct(Podcast $podcast)
{
$this->podcast = $podcast->withoutRelations();
}

Read through the updated queue documentation for more details.

Resource collections can now preserve query parameters on paginated API resources with the preserveQueryParameters() method:

return MyResourceCollection::make($repository->paginate())
->preserveQueryParameters();

You can see the full list of new features and updates below and the whole diff between 6.6.2 and 6.7.0 on GitHub. The full release notes for Laravel 6.0 are available in the GitHub v6 changelog:

v6.7.0

Added

  • Added getQualifiedCreatedAtColumn() and getQualifiedUpdatedAtColumn() methods to HasTimestamps concern (#30792)
  • Added exceptionContext() method to the Exceptions\Handler (#30780)
  • Added ability for postmark transport to throw errors (#30799, 4320b82)
  • Added withoutRelations() and unsetRelations() methods to HasRelationships (#30802)
  • Added ResourceCollection::preserveQueryParameters() for preserve query parameters on paginated api resources (#30745, e92a708)

Fixed

  • Fixed explicit models in string-based database validation rules (#30790)
  • Fixed Routing\RedirectController() (#30783)

Changed

  • Reconnect PhpRedisConnection on connection missing (#30778)
  • Improved ShouldBroadcastNow performance (#30797, 5b3cc97)
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
Tinkerwell

Version 4 of Tinkerwell is available now. Get the most popular PHP scratchpad with all its new features and simplify your development workflow today.

Visit Tinkerwell
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
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
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
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
Lucky Media logo

Lucky Media

Bespoke software solutions built for your business. We ♥ Laravel

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
All Green logo

All Green

All Green is a SaaS test runner that can execute your whole Laravel test suite in mere seconds so that you don't get blocked – you get feedback almost instantly and you can deploy to production very quickly.

All Green
Larafast: Laravel SaaS Starter Kit logo

Larafast: Laravel SaaS Starter Kit

Larafast is a Laravel SaaS Starter Kit with ready-to-go features for Payments, Auth, Admin, Blog, SEO, and beautiful themes. Available with VILT and TALL stacks.

Larafast: Laravel SaaS Starter Kit
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a 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
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector

The latest

View all →
Property Hooks Get Closer to Becoming a Reality in PHP 8.4 image

Property Hooks Get Closer to Becoming a Reality in PHP 8.4

Read article
Asserting Exceptions in Laravel Tests image

Asserting Exceptions in Laravel Tests

Read article
Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4 image

Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4

Read article
Basset is an alternative way to load CSS & JS assets image

Basset is an alternative way to load CSS & JS assets

Read article
Integrate Laravel with Stripe Connect Using This Package image

Integrate Laravel with Stripe Connect Using This Package

Read article
The Random package generates cryptographically secure random values image

The Random package generates cryptographically secure random values

Read article