jd12404
jd12404

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

1-1 of 1