mardi 1 décembre 2020

WhereHas is not working in laravel server

WhereHas condition is not working in the server because of the updated version. but it is working in local. so plesase suggest me the alternative of this: here is the query i am trying to execute:

$purchased_courses = Course::whereHas('students' => function($query) {
                $query->where('id', Auth::id());
            })
            ->with('lessons')
            ->orderBy('id', 'desc')
            ->get();


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire