order by with all laravel code example
Example 1: laravel order by
$users = DB::table('users')
-> orderBy('name', 'desc')
-> get();
Example 2: get all sort by laravel
$results = Project::orderBy('name')->get();
$users = DB::table('users')
-> orderBy('name', 'desc')
-> get();
$results = Project::orderBy('name')->get();