iterate over collection laravel 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;
}