Last active
September 29, 2021 08:22
-
-
Save alixcan/935dacde15872b5d67ffec6226c25267 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//dd($request->route()); | |
/* | |
$routes = []; | |
foreach (\Route::getRoutes()->getIterator() as $route){ | |
if (strpos($route->uri, 'api') !== false){ | |
$routes[] = $route->uri; | |
} | |
} | |
dd($routes); | |
*/ | |
/* $route_name = []; | |
foreach (\Route::getRoutes()->getRoutes() as $route) { | |
$action = $route->getAction(); | |
if (array_key_exists('as', $action)) { | |
$route_name[] = $action['as']; | |
} | |
} | |
dd($route_name);*/ | |
/* | |
$routes = collect(\Route::getRoutes())->map(function ($route) { return $route->uri(); }); | |
return ($routes); | |
*/ | |
/* | |
$routes = collect(\Route::getRoutes())->map(function ($route) { return $route->action; }); | |
return ($routes); | |
*/ | |
/* \Artisan::call('route:list'); | |
return '<pre>'.\Artisan::output(); | |
*/ | |
/* $route_name = []; | |
foreach (\Route::getRoutes()->getRoutes() as $route) { | |
$action = $route->getAction(); | |
if (array_key_exists('as', $action)) { | |
$route_name[] = $action['as']; | |
} | |
} | |
foreach ($route_name as $key => $value) { | |
echo $value . ' - ' . $key . '<br>'; | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment