model = $model; $this->citiesEntryTranslationsModel = $citiesEntryTranslationsModel; } public function findById($id) { return $this->model->orderBy('created_at', 'DESC')->where('location_cities.id', $id)->first(); } public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc') { return $this->citiesEntryTranslationsModel->newQuery() ->select('entry_id as id', 'name') ->whereIn('locale', [ Request()->session()->get('_locale'), setting_value('streams::default_locale'), 'en' ]) ->whereIn('entry_id', $entryIDs) ->orderBy($orderBy, $direction) ->get(); } }