I have upgraded Laravel from 5.6 to 6.0. Previously, default helper functions were running fine on the controllers, but now it says \"undefined.\" In my con
use code ::
insertGetId( [
'name'=>'Sample'.$count,
'password'=>random_int(1000000,99999999)
]);
foreach (range(1,rand(1,3)) as $index ){
DB::insert('INSERT INTO posts (userid,title,body) VALUES (:userid,:title,:body)',[
'userid'=>$id,
'title'=>str::random(15),
'body'=>str::random(50),
]);
}
DB::commit();
}
}catch (\Exception $errors){
DB::rollBack();
Log::error($errors);
return "mission filed";
}
}