eloquent get() in loop or loop over collection code example
Example: laravel loop through collection
$users = App\User::where('active', 1)->get();
foreach ($users as $user) {
echo $user->name;
}
$users = App\User::where('active', 1)->get();
foreach ($users as $user) {
echo $user->name;
}