diff --git a/src/Facades/Rapidez.php b/src/Facades/Rapidez.php index 1df234d9c..b45fb7654 100644 --- a/src/Facades/Rapidez.php +++ b/src/Facades/Rapidez.php @@ -6,6 +6,7 @@ /** * @method static self addFallbackRoute($action, $position = 9999) + * @method static self removeFallbackRoute($action) * @method static Collection getAllFallbackRoutes() * @method static ?string config(string $path, $default = null, bool $sensitive = false) * @method static ?string content($content) diff --git a/src/Rapidez.php b/src/Rapidez.php index 55550bf64..6bcb25e21 100644 --- a/src/Rapidez.php +++ b/src/Rapidez.php @@ -21,6 +21,14 @@ public function addFallbackRoute($action, $position = 9999) return $this; } + public function removeFallbackRoute($action) + { + $action = RouteAction::parse('', $action); + $this->routes = $this->routes->reject(fn ($route) => $route['action'] === $action); + + return $this; + } + public function getAllFallbackRoutes() { return $this->routes->sortBy('position');