Sort by translated columnCreated 4 years ago by pooria
I'm trying to sort the results by a column in translated table. I'm using this code:
$arr = FacultyModel::join('people_faculty_translations as t', 't.entry_id', '=', 'people_faculty.id') ->where('t.locale', \App::getLocale()) ->orderBy('t.last_name', 'asc') ->get();
But the problem is that by doing this, The relationships become empty. For example when I try to get
$arr->articles It returns an empty array, but when I use
$arr = FacultyModel::all() to retrieve data,
What's the resulting query? Any clues there?