laravel order by eloquent asc code example
Example 1: laravel order by desc
$posts = Post::orderBy('id', 'DESC')->get();
Example 2: laravel order by
$users = DB::table('users')
-> orderBy('name', 'desc')
-> get();
$posts = Post::orderBy('id', 'DESC')->get();
$users = DB::table('users')
-> orderBy('name', 'desc')
-> get();