Skip to content

Commit

Permalink
route expose false option
Browse files Browse the repository at this point in the history
  • Loading branch information
tugrul committed Apr 4, 2021
1 parent ca27239 commit 6b29b97
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Extractor/ExposedRoutesExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ public function getRoutes()
foreach ($collection->all() as $name => $route) {

if ($route->hasOption('expose')) {
$routes->add($name, $route);

$expose = $route->getOption('expose');

if ($expose !== false && $expose !== 'false') {
$routes->add($name, $route);
}
continue;
}

Expand Down Expand Up @@ -196,8 +201,12 @@ public function getResources()
*/
public function isRouteExposed(Route $route, $name)
{
return true === $route->hasOption('expose') ||
('' !== $this->pattern && preg_match('#^' . $this->pattern . '$#', $name));
if (false === $route->hasOption('expose')) {
return ('' !== $this->pattern && preg_match('#^' . $this->pattern . '$#', $name));
}

$status = $route->getOption('expose');
return ($status !== false && $status !== 'false');
}

protected function getDomainByRouteMatches($matches, $name)
Expand Down

0 comments on commit 6b29b97

Please # to comment.