Hello,
I'm trying to order the data from a relation but it doesn't work. Any hint would be greatly appreciated:
protected function loadDates(){
$dateId = $this->param('slug');
$thedates = EventModel::where('slug',[$dateId])
->with([
'dates' => function($query) {
$query->orderByDesc('name');
}
])->get();
return $thedates;
}
No errors is showing... it's just not working.
Last updated