you are using mass assignment so make sure fields are fillable or unguarded in your model
Jul 21, 2024
9
Level 1
Job queque not creating DB laravel 11
Hi have a great day, im glad if any expert wanna help me. do anyone know why my queque job didnt creating data to DB ?, but at the terminal its said DONE, im using laravel 11
in Jobs/Prize5.php;
public function handle(): void
{
$games= Game::all();
foreach ($games as $game) {
$angkaUnik = range(0,9);
shuffle($angkaUnik);
$prize5 = implode('',array_slice($angkaUnik,0,6));
$data = [
'id_game'=>$game->id,
'prize5'=> $prize5,
];
Result::create($data);
}
}
then in routes/console.php
$timer = Timer::all();
Schedule::job(new Prize5())->dailyAt('[$timer->prize5]');
Please or to participate in this conversation.