laravel sortby asc and desc code example
Example 1: laravel order by desc
$posts = Post::orderBy('id', 'DESC')->get();
Example 2: get all sort by laravel
$results = Project::orderBy('name')->get();
$posts = Post::orderBy('id', 'DESC')->get();
$results = Project::orderBy('name')->get();