We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ac8eebe + f6bd689 commit dae7f2dCopy full SHA for dae7f2d
src/Middleware/RestrictAccessByGeo.php
@@ -94,17 +94,16 @@ protected function shouldApply(Request $request): bool
94
{
95
$only = Config::get('geo-restrict.routes.only', []);
96
$except = Config::get('geo-restrict.routes.except', []);
97
- $current = $request->route()?->getName() ?? $request->path();
98
99
foreach ($except as $pattern) {
100
- if (fnmatch($pattern, $current)) {
+ if ($request->routeIs($pattern) || $request->is($pattern)) {
101
return false;
102
}
103
104
105
if (!empty($only)) {
106
foreach ($only as $pattern) {
107
108
return true;
109
110
0 commit comments