Route.php 841 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Module\System\Repositorys;
  3. use Dcat\Admin\Grid;
  4. use Dcat\Admin\Repositories\Repository;
  5. use Illuminate\Support\Facades\Log;
  6. use Monolog\Handler\StreamHandler;
  7. /**
  8. * 所有的路由
  9. *
  10. */
  11. class Route extends Repository
  12. {
  13. /**
  14. * 合并RouteName功能 - 获取命名路由
  15. */
  16. public function getNamedRoutes()
  17. {
  18. $list = [];
  19. $routes = \Illuminate\Support\Facades\Route::getRoutes();
  20. foreach ($routes->getRoutesByName() as $route) {
  21. $list[] = $route->action;
  22. }
  23. return $list;
  24. }
  25. public function get(Grid\Model $model)
  26. {
  27. $list = [];
  28. $routes = \Illuminate\Support\Facades\Route::getRoutes();
  29. foreach ($routes->getRoutes() as $route) {
  30. $list[] = $route->action;
  31. }
  32. return $list;
  33. }
  34. }