Nithin John
Nithin John

Reputation: 917

How to access a method in 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?

Upvotes: 3

Views: 1632

Answers (1)

Alessandro Minoccheri
Alessandro Minoccheri

Reputation: 35973

try his:

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

Upvotes: 2

Related Questions