Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel OrderBy on Eloquent whereHas relationship

$counties = County::whereHas('items', function ($query) {
    $query->where('approved', 1);
})->orderBy('name')->get();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #OrderBy #Eloquent #whereHas #relationship
ADD COMMENT
Topic
Name
1+9 =