Laravel Scheduling call controller

后端 未结 5 1673
北荒
北荒 2021-01-04 05:23

I work with Laravel Task Scheduling, but I have a problem when I call some method from my controller.

protected function schedule(Schedule $schedule)
{
    $         


        
5条回答
  •  既然无缘
    2021-01-04 05:52

    I stumbled months ago with the same problem, until I could fix it. I use laravel 5.2 and the kernel call my drivers this way:

    $schedule->call('App\Http\Controllers\MyController@MyAction')->everyMinute();
    

    I hope this will help someone else ;)

提交回复
热议问题