framework: `php artisan schedule:list` does not support fluent-style scheduling

Laravel Version

11.0.7

PHP Version

8.3.4

Database Driver & Version

No response

Description

As found out in #50120 - the php artisan schedule:list is broken for fluent-style scheduling entries.

The scheduling still works as expected, but the list is displayed incorrectly.

Using the example from the docs (https://laravel.com/docs/11.x/scheduling#between-time-constraints):

$schedule->command('emails:send')
      ->hourly()
      ->between('7:00', '22:00');

php artisan schedule:list:

  0 * * * *    php artisan emails:send ......................... Next Due: in 8 Minutes

As you can see the configuration is displayed as a seemingly random value, in this case just hourly.

Related Laracasts topic:

https://laracasts.com/discuss/channels/laravel/schedule-between-not-working-as-expected

Steps To Reproduce

add

$schedule->command('emails:send')
      ->hourly()
      ->between('7:00', '22:00');

to routes/console.php and launch

php artisan schedule:list

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

No problem, totally understandable, however I think @JonPurvis, the author of https://github.com/laravel/framework/pull/47983 knows this stuff best, however his PR was denied by @taylorotwell for reasons I couldn’t fully understand.

Anyway me personally, I am out of my depth here, I’ve never did anything in Laravel internals at this point I and am frankly out of motivation to take this one up, as I accidentally lost the huge real-life schedule file that took me all evening to convert from cron to fluent-calls. I couldn’t verify I did no unintended changes and eventually lost the change 😃

Hey @driesvints

Certainly, I actually meant to do this when Taylor tagged me but it slipped my mind. I’ll re-create this PR targeted to Laravel 12 this week so I don’t forget! I believe it’s still worth looking into.