Пример #1
0
 public function testCategory()
 {
     $this->tryRoute('store.shop.category', [CategoryTranslation::first()]);
 }
Пример #2
0
 /**
  * @param $sub
  * @return static
  */
 protected function category($sub)
 {
     $title = $sub->subcategorie;
     $category = CategoryTranslation::where('name', $title)->first();
     if (!$category) {
         $category = Category::create(['nl' => ['name' => $title], 'en' => ['name' => $title]]);
         return $category;
     } else {
         $category = $category->category;
         return $category;
     }
 }