Answers for "laravel raw order by"

PHP
1

laravel order by raw

$orders = DB::table('orders')
                ->orderByRaw('updated_at - created_at DESC')
                ->get();
Posted by: Guest on May-04-2020
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

Browse Popular Code Answers by Language