laravel 5 do query with sql code example
Example 1: laravel sql query
use Illuminate\Support\Facades\DB;
$users = DB::select('select * from users');
foreach ($users as $user) {
echo $user->name;
}
Example 2: laravel chunk select
DB::table('users')->chunk(100, function($users)
{
foreach ($users as $user)
{
//
}
});