How do I access a method in a controller in laravel scheduler?

I need to access a method of my UserController in laravel scheduler function,

protected function schedule(Schedule $schedule)
{
    $schedule->command('foo')
             ->hourly();
}

      

Is it possible?

+3


source to share


1 answer


try it:



$schedule->call('Full\Namespace\YourController@method')
    ->hourly();

      

+2


source







All Articles