laravel all orderby code example
Example 1: laravel order by
$users = DB::table('users')
-> orderBy('name', 'desc')
-> get();
Example 2: laravel get all records order by
$posts = Post::orderBy('created_at', 'desc')->get();
Example 3: get all sort by laravel
$results = Project::orderBy('name')->get();
Example 4: laravel get all records order by
$results = Project::orderBy('name')->get();