The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

Laravel 7.19 Released

Published on by

Laravel 7.19 Released image

Never Miss a Laravel Release 🚀

Sign up and get an email with each new Laravel release

The Laravel team released v7.19.0 with new scheduler frequency shortcuts, conditionally appending attributes to API resources and a new Stringable when() method:

Scheduler Frequency Shortcuts

Sjors Ottjes contributed more useful scheduler frequency shortcuts:

  • everyTwoHours()
  • everyThreeHours()
  • everyFourHours()
  • everySixHours()

They provide readable shortcuts instead of using cron:

// Using cron
$schedule->job(SyncSomething::class)->cron('0 */2 * * *');
 
// Shortcut from this release
$schedule->job(SyncSomething::class)->everyTwoHours();

Conditionally Return Appended Attributes in API Resources

Jess Archer contributed a whenAppended method for API resources to append attributes conditionally. Here are some examples taken from the contributed tests:

public function toArray($request)
{
return [
'id' => $this->id,
'first' => $this->whenAppended('is_published'),
'second' => $this->whenAppended('is_published', 'override value'),
'third' => $this->whenAppended('is_published', function () {
return 'override value';
}),
'fourth' => $this->whenAppended('is_published', $this->is_published, 'default'),
'fifth' => $this->whenAppended('is_published', $this->is_published, function () {
return 'default';
}),
];
}
 
// Controller Example
return new UserResource($user->append('is_subscribed'));

Scheduled Task Failed Event

Freek Van der Herten contributed a ScheduledTaskFailed event that fires when a scheduled task fails:

$this->dispatcher->dispatch(new ScheduledTaskFailed($event, $e));

Stringable when() Method

Manojkiran Appathurai contributed a Stringable::when() method to conditionally run some “stringable” code when true:

Str::of($blogContent)
->when(! Auth::check(), function ($stringable) {
return $stringable
->limit(20)
->append('To Continue reading ')
->append(new HtmlString(
'<a href="#">Get a Subscription</a>'
));
});

Release Notes

You can see the full list of new features and updates below and the diff between 7.18.0 and 7.19.0 on GitHub. The following release notes are directly from the changelog:

v7.19.0

Added

  • Added everyTwoHours() | everyThreeHours() | everyFourHours() | everySixHours() methods to Illuminate\Console\Scheduling\ManagesFrequencies (#33393)
  • Conditionally returning appended attributes in API resources (#33422)
  • Added ScheduledTaskFailed event (#33427)
  • Added Illuminate\Support\Stringable::when() (#33455)

Fixed

  • Fixed signed urls with custom parameters (bcb133e)
  • Determine model key name correctly in Illuminate/Validation/Concerns/ValidatesAttributes.php (a1fdd53)
  • Fixed notifications database channel for anonymous notifiables (#33409)

Changed

  • Improve SQL Server last insert id retrieval (#33430, de1d159)
  • Make Str::endsWith return false if both haystack and needle are empty strings (#33434)
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
Laravel Cloud

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

Visit Laravel Cloud
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
Tinkerwell logo

Tinkerwell

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

Tinkerwell
Lucky Media logo

Lucky Media

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

Lucky Media
Laravel Cloud logo

Laravel Cloud

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

Laravel Cloud
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
SerpApi logo

SerpApi

Access real-time search engine results through a simple API—no more scraping headaches! Use it for AI applications, SEO tools, product research, travel information, and more

SerpApi
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Shift logo

Shift

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

Shift

The latest

View all →
Larapanda: A Type-Safe Lightpanda Browser SDK for Laravel image

Larapanda: A Type-Safe Lightpanda Browser SDK for Laravel

Read article
Generate HTML Password Rules Attribute in Laravel 13.9.0 image

Generate HTML Password Rules Attribute in Laravel 13.9.0

Read article
DHH Joins Laravel Live Denmark 2026 for Fireside Chat with Taylor Otwell image

DHH Joins Laravel Live Denmark 2026 for Fireside Chat with Taylor Otwell

Read article
Model-Based Scheduling for Laravel with Cadence image

Model-Based Scheduling for Laravel with Cadence

Read article
Laravel's AI SDK adds sub-agents image

Laravel's AI SDK adds sub-agents

Read article
Laravel Introduces First-Party Passkey Authentication Support image

Laravel Introduces First-Party Passkey Authentication Support

Read article