Laravel 的 task scheduler 让你用流畅的方式在 代码中 定义计划任务(重复执行的任务)——如日报告、清理或发送提醒——而不是管理众多独立的 cron 条目。一个单一的 cron 条目运行 Laravel 的调度程序,然后在计划时间运行你定义的任务。
为什么这很重要
Traditionally, each recurring task needs its own crontab entry on the server
→ scattered, hard to version-control, server-specific, error-prone.
Laravel: define ALL scheduled tasks in code (version-controlled), with ONE cron entry.
定义计划任务(代码中)
->()->();
->()->();
->( )->();
->(fn() => DB::()->(...)->())->();
->() ->() ->() ->() ->()
->() ->() ->()
