diff --git a/RouteManager.php b/RouteManager.php index 5a76905..f92497f 100644 --- a/RouteManager.php +++ b/RouteManager.php @@ -2,6 +2,7 @@ use Closure; use Illuminate\Support\Arr; +use Illuminate\Routing\Events\RouteMatched; use Illuminate\Support\NamespacedItemResolver; use Illuminate\Contracts\Foundation\Application; use Orchestra\Contracts\Http\RouteManager as RouteManagerContract; @@ -194,7 +195,7 @@ public function route($name, $default = '/') */ public function when($path, $listener) { - return $this->whenOn($path, 'router.matched', $listener); + return $this->whenOn($path, RouteMatched::class, $listener); } /**