uri)[1]; switch ($type) { case 'gamme': $range = Ranges::where([['slug', $slug], ['status', 1]])->first(); if (!$range) abort(404); dd('Gamme : ' . $range->name); break; case 'type-viande': $meatType = MeatTypes::where([['name', ucfirst($slug)], ['status', 1]])->first(); if (!$meatType) abort(404); dd('Type de viande : ' . $meatType->name); break; case 'moment-conso': $moment = Moments::where([['slug', $slug], ['status', 1]])->first(); if (!$moment) abort(404); dd('Moment consomation : ' . $moment->title); break; default: abort(404); break; } } }