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
Jump24 - UK Laravel Agency

Laravel Developers that Click into Place. Never outsourced. Never offshored. Always exceptional.

Visit Jump24 - UK Laravel Agency
Tinkerwell logo

Tinkerwell

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

Tinkerwell
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
PhpStorm logo

PhpStorm

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

PhpStorm
Laravel Cloud logo

Laravel Cloud

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

Laravel Cloud
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
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
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
Lucky Media logo

Lucky Media

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

Lucky Media
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 →
Log User Activity in Your Laravel App with Activity Log v5  image

Log User Activity in Your Laravel App with Activity Log v5

Read article
Manage Laravel Cloud from the Terminal with the New Cloud CLI image

Manage Laravel Cloud from the Terminal with the New Cloud CLI

Read article
UnitTest Attribute and More in Laravel 13.3.0 image

UnitTest Attribute and More in Laravel 13.3.0

Read article
PAO: Agent-Optimized Output for PHP Testing Tools image

PAO: Agent-Optimized Output for PHP Testing Tools

Read article
PhpStorm 2026.1 Released image

PhpStorm 2026.1 Released

Read article
Ship AI with Laravel: Smart Ticket Triage with Structured Output image

Ship AI with Laravel: Smart Ticket Triage with Structured Output

Read article