/var/www/flurhymez/vendor/laravel/framework/src/Illuminate/Foundation/Console
NameSizeModeActions
stubs/-0755rm
CastMakeCommand.php12850644editdlrm
ChannelMakeCommand.php13000644editdlrm
ClearCompiledCommand.php8350644editdlrm
ClosureCommand.php19680644editdlrm
ComponentMakeCommand.php34590644editdlrm
ConfigCacheCommand.php20650644editdlrm
ConfigClearCommand.php10750644editdlrm
ConsoleMakeCommand.php21940644editdlrm
DownCommand.php41280644editdlrm
EnvironmentCommand.php6240644editdlrm
EventCacheCommand.php13960644editdlrm
EventClearCommand.php11090644editdlrm
EventGenerateCommand.php18980644editdlrm
EventListCommand.php24100644editdlrm
EventMakeCommand.php16050644editdlrm
ExceptionMakeCommand.php19530644editdlrm
JobMakeCommand.php18000644editdlrm
Kernel.php95930644editdlrm
KeyGenerateCommand.php28260644editdlrm
ListenerMakeCommand.php27200644editdlrm
MailMakeCommand.php34370644editdlrm
ModelMakeCommand.php62270644editdlrm
NotificationMakeCommand.php31590644editdlrm
ObserverMakeCommand.php34450644editdlrm
OptimizeClearCommand.php7870644editdlrm
OptimizeCommand.php6300644editdlrm
PackageDiscoverCommand.php9040644editdlrm
PolicyMakeCommand.php49520644editdlrm
ProviderMakeCommand.php13010644editdlrm
QueuedCommand.php8480644editdlrm
RequestMakeCommand.php13210644editdlrm
ResourceMakeCommand.php22840644editdlrm
RouteCacheCommand.php26790644editdlrm
RouteClearCommand.php10560644editdlrm
RouteListCommand.php79570644editdlrm
RuleMakeCommand.php18070644editdlrm
ServeCommand.php52150644editdlrm
StorageLinkCommand.php20500644editdlrm
StubPublishCommand.php44450644editdlrm
TestMakeCommand.php24330644editdlrm
UpCommand.php12740644editdlrm
VendorPublishCommand.php73480644editdlrm
ViewCacheCommand.php20440644editdlrm
ViewClearCommand.php13230644editdlrm
Edit: /var/www/flurhymez/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php (7957B)
router = $router; } /** * Execute the console command. * * @return void */ public function handle() { $this->router->flushMiddlewareGroups(); if (empty($this->router->getRoutes())) { return $this->error("Your application doesn't have any routes."); } if (empty($routes = $this->getRoutes())) { return $this->error("Your application doesn't have any routes matching the given criteria."); } $this->displayRoutes($routes); } /** * Compile the routes into a displayable format. * * @return array */ protected function getRoutes() { $routes = collect($this->router->getRoutes())->map(function ($route) { return $this->getRouteInformation($route); })->filter()->all(); if (($sort = $this->option('sort')) !== 'precedence') { $routes = $this->sortRoutes($sort, $routes); } if ($this->option('reverse')) { $routes = array_reverse($routes); } return $this->pluckColumns($routes); } /** * Get the route information for a given route. * * @param \Illuminate\Routing\Route $route * @return array */ protected function getRouteInformation(Route $route) { return $this->filterRoute([ 'domain' => $route->domain(), 'method' => implode('|', $route->methods()), 'uri' => $route->uri(), 'name' => $route->getName(), 'action' => ltrim($route->getActionName(), '\\'), 'middleware' => $this->getMiddleware($route), ]); } /** * Sort the routes by a given element. * * @param string $sort * @param array $routes * @return array */ protected function sortRoutes($sort, array $routes) { return Arr::sort($routes, function ($route) use ($sort) { return $route[$sort]; }); } /** * Remove unnecessary columns from the routes. * * @param array $routes * @return array */ protected function pluckColumns(array $routes) { return array_map(function ($route) { return Arr::only($route, $this->getColumns()); }, $routes); } /** * Display the route information on the console. * * @param array $routes * @return void */ protected function displayRoutes(array $routes) { if ($this->option('json')) { $this->line($this->asJson($routes)); return; } $this->table($this->getHeaders(), $routes); } /** * Get the middleware for the route. * * @param \Illuminate\Routing\Route $route * @return string */ protected function getMiddleware($route) { return collect($this->router->gatherRouteMiddleware($route))->map(function ($middleware) { return $middleware instanceof Closure ? 'Closure' : $middleware; })->implode("\n"); } /** * Filter the route by URI and / or name. * * @param array $route * @return array|null */ protected function filterRoute(array $route) { if (($this->option('name') && ! Str::contains($route['name'], $this->option('name'))) || $this->option('path') && ! Str::contains($route['uri'], $this->option('path')) || $this->option('method') && ! Str::contains($route['method'], strtoupper($this->option('method')))) { return; } if ($this->option('except-path')) { foreach (explode(',', $this->option('except-path')) as $path) { if (Str::contains($route['uri'], $path)) { return; } } } return $route; } /** * Get the table headers for the visible columns. * * @return array */ protected function getHeaders() { return Arr::only($this->headers, array_keys($this->getColumns())); } /** * Get the column names to show (lowercase table headers). * * @return array */ protected function getColumns() { $availableColumns = array_map('strtolower', $this->headers); if ($this->option('compact')) { return array_intersect($availableColumns, $this->compactColumns); } if ($columns = $this->option('columns')) { return array_intersect($availableColumns, $this->parseColumns($columns)); } return $availableColumns; } /** * Parse the column list. * * @param array $columns * @return array */ protected function parseColumns(array $columns) { $results = []; foreach ($columns as $i => $column) { if (Str::contains($column, ',')) { $results = array_merge($results, explode(',', $column)); } else { $results[] = $column; } } return array_map('strtolower', $results); } /** * Convert the given routes to JSON. * * @param array $routes * @return string */ protected function asJson(array $routes) { return collect($routes) ->map(function ($route) { $route['middleware'] = empty($route['middleware']) ? [] : explode("\n", $route['middleware']); return $route; }) ->values() ->toJson(); } /** * Get the console command options. * * @return array */ protected function getOptions() { return [ ['columns', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Columns to include in the route table'], ['compact', 'c', InputOption::VALUE_NONE, 'Only show method, URI and action columns'], ['json', null, InputOption::VALUE_NONE, 'Output the route list as JSON'], ['method', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by method'], ['name', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by name'], ['path', null, InputOption::VALUE_OPTIONAL, 'Only show routes matching the given path pattern'], ['except-path', null, InputOption::VALUE_OPTIONAL, 'Do not display the routes matching the given path pattern'], ['reverse', 'r', InputOption::VALUE_NONE, 'Reverse the ordering of the routes'], ['sort', null, InputOption::VALUE_OPTIONAL, 'The column (precedence, domain, method, uri, name, action, middleware) to sort by', 'uri'], ]; } }