order laravel query results code example
Example 1: laravel order by
$users = DB::table('users')
-> orderBy('name', 'desc')
-> get();
Example 2: laravel order by raw
$orders = DB::table('orders')
->orderByRaw('updated_at - created_at DESC')
->get();