Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 349 Bytes

sorting.md

File metadata and controls

12 lines (9 loc) · 349 Bytes

Sorting

By default, your search results will be sorted by their score according to Elasticsearch. If you want to step in and influence the sorting you may do so using the default orderBy() function from Laravel Scout.

use App\Models\Post;

$results = Post::search('Self-steering')
    ->orderBy('published_at', 'desc')
    ->get();