/** * Restituisce una categoria a partire dal suo slug. * * @param $slug * @return mixed * @throws NotFoundException */ public function findBySlug($slug) { $category = Category::where('slug', '=', $slug)->first(); if (!$category) { throw new NotFoundException(); } return $category; }