Laravel Version
11.34.0
PHP Version
8.3.14
Database Driver & Version
No response
Description
Hi,
With the latest update, schedule grouping throws an Exception when using job method.
@istiak-tridip you will probably be the first to know what's going on.
LogicException
A scheduled event name is required to prevent overlapping. Use the 'name' method before 'withoutOverlapping'.
at vendor\laravel\framework\src\Illuminate\Console\Scheduling\CallbackEvent.php:142
138▕ */
139▕ public function withoutOverlapping($expiresAt = 1440)
140▕ {
141▕ if (! isset($this->description)) {
➜ 142▕ throw new LogicException(
143▕ "A scheduled event name is required to prevent overlapping. Use the 'name' method before 'withoutOverlapping'."
144▕ );
145▕ }
Steps To Reproduce
<?php
// routes/console.php
use Illuminate\Support\Facades\Schedule;
use Illuminate\Console\Scheduling\Schedule as ConsoleSchedule;
Schedule::onOneServer()
->runInBackground()
->withoutOverlapping()
->group(static function (ConsoleSchedule $schedule): void {
// HOURLY
$schedule->hourly()
->group(static function (ConsoleSchedule $schedule): void {
$schedule->job(new SomeJobClass);
});
});