When i use php artisan schedule:run
command the shuffleQuoteOfTheDay
method is evaluated once and then it does not fire it every minute.
Kernel@schedule method
protected function schedule(Schedule $schedule)
{
$schedule->call('App\Services\MotivationalQuoteService@shuffleQuoteOfTheDay')->everyMinute();
}
MotivationalQuoteService@shuffleQuoteOfTheDay method
public function shuffleQuoteOfTheDay(){
$currentQuoteOfADay = $this->getQuoteOfTheDay();
$randomQuote = MotivationalQuote::where('quote_of_the_day',false)->inRandomOrder()->first();
$currentQuoteOfADay->update(['quote_of_the_day' => false]);
$randomQuote->update(['quote_of_the_day' => true]);
return $randomQuote;
}
It does work once but not every minute, i have created jobs table.Can someone help me with this?Thank you in advance.