protected function getCategoryOptions($lang) { $categories = Category::all(); $categoryOptions = []; foreach ($categories as $category) { $translation = $category->translate($lang, true); $categoryOptions[$category->id] = $translation->title; } return $categoryOptions; }
public function resourceCategories() { $categories = Category::all(); $content = view('frontend.sitemap.resource_categories', ['categories' => $categories])->render(); return response($content, 200)->header('Content-Type', 'text/xml'); }