亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Using Eloquent for internal querying
P粉056618053
P粉056618053 2024-04-06 16:45:50
0
1
963

Image address contains location and total number of users.

Users::with(['address'=>function($query){
    $query->where('location', 'NAXAL');
    $query->order By('total');
    }])->get();

This query will return all users, and relationships not matched by the query will be empty. I only want to extract those users who are not null on the relationship and sort accordingly.

P粉056618053
P粉056618053

reply all(1)
P粉627136450

You can use whereHas condition

Users::whereHas('address', function($query){
$query->where('location', 'NAXAL');
$query->order By('total');
})->get();
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template