samedi 28 janvier 2017

Laravel Task Schedule inside loop

        protected function schedule(Schedule $schedule)
        {    
             for ($i=1; $i < 59; $i++) { 
             $timezone ="Asia/Dhaka";
             $insert =  Check_insert::create([
                            'name'=>'someting is happening'.$i
                            ]);
             $scc = $schedule->call($insert)->dailyAt("11:0".$i)->timezone($timezone);
             }
        }

The problem is task scheduling working perfectly but value of $i is always saving 1 in database but working on dailyAt field perfectly.. Please Help



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire