public function getSitemapById($id, $depth, $parent_id) { //dc($slug.','.$depth.','.$parent_id); $sitemap = Sitemap::whereHas('translations.locale', function ($q) use($id) { $q->where('languageCode', '' . app()->getLocale() . ''); })->where('id', $id)->where('depth', $depth)->where('parent_id', $parent_id)->firstOrFail(); return $sitemap; }