Answers for "laravel 5 do query with sql"

PHP
0

laravel sql query

use Illuminate\Support\Facades\DB;

$users = DB::select('select * from users');

foreach ($users as $user) {
    echo $user->name;
}
Posted by: Guest on January-07-2021
0

laravel chunk select

DB::table('users')->chunk(100, function($users)
{
    foreach ($users as $user)
    {
        //
    }
});
Posted by: Guest on September-20-2020

Browse Popular Code Answers by Language