firstOrFail(); return match ($user->type) { UserType::ARTIST->value => (new ArtistController())->show($username), UserType::MANAGER->value => (new ManagerController())->show($username), UserType::ORGANIZER->value => (new OrganizerController())->show($username), default => throw new \Exception('Unexpected value'), }; } }