Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 477b1d1

Browse files
committed
Update filter routes
1 parent ed517ae commit 477b1d1

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/Console/CreateJSRoutesCommand.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ public function handle()
4242
{
4343
$routes = collect(
4444
Route::getRoutes()->getRoutesByName()
45-
)->filter(function ($e, $k) {
46-
return $this->includeRoute($e, $k);
47-
})->map(function ($e) {
45+
)->filter(function ($route, $key) {
46+
return $this->includeRoute($route, $key);
47+
})->map(function ($route) {
4848
return [
49-
"uri" => $e->uri
49+
"uri" => $route->uri
5050
];
5151
});
5252

@@ -97,14 +97,9 @@ public function createFile($fileName, $contents)
9797
return true;
9898
}
9999

100-
private function includeRoute($value, $routeName)
100+
private function includeRoute($route, $routeName)
101101
{
102102
$valid = $routeName !== 'telescope';
103-
$valid &= (
104-
in_array('GET', $value->methods) ||
105-
$routeName === 'read-notifications.update'
106-
);
107-
108103
return $valid;
109104
}
110105

0 commit comments

Comments
 (0)