how to create laravel collection using foreach loop 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;
}