how to sort laravel collection code example
Example 1: sort laravel eloquent
$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();