コード例 #1
0
ファイル: PostController.php プロジェクト: yohanes1989/goprop
 protected function getCategoryOptions($lang)
 {
     $categories = Category::all();
     $categoryOptions = [];
     foreach ($categories as $category) {
         $translation = $category->translate($lang, true);
         $categoryOptions[$category->id] = $translation->title;
     }
     return $categoryOptions;
 }
コード例 #2
0
 public function resourceCategories()
 {
     $categories = Category::all();
     $content = view('frontend.sitemap.resource_categories', ['categories' => $categories])->render();
     return response($content, 200)->header('Content-Type', 'text/xml');
 }