loadViewFromSlug($slug); } return $this->$methodName(); } // You can override a slug2view behavior protected function yourCustomMethod() { // Return whatever you want return view('layouts.static.your_view'); } protected function loadViewFromSlug($slug) { $slug = $this->slugToSnakeCase($slug); try { return view("layouts.static.{$slug}"); } catch (\InvalidArgumentException $e) { abort(404); } } protected function slugToSnakeCase($slug) { return str_replace('-', '_', $slug); } }