I want to get all of route and register to fake.php file like this:
$getRouteCollection = Route::getRoutes(); //get and returns all returns route collection
foreach ($getRouteCollection as $route) {
Route::{'fake/' . $route->methods()[0]}($route->uri, [$route->getController(), $route->function()]);
}
i need to add prefix to all of route, and all routes work like before.
source https://stackoverflow.com/questions/69328794/how-to-get-all-routes-and-register-in-other-file-in-laravel
Comments
Post a Comment