public function testCategory() { $this->tryRoute('store.shop.category', [CategoryTranslation::first()]); }
/** * @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; } }