Skip to content

Commit 9ac22e8

Browse files
authored
Merge pull request #2 from fmfernandes/master
Add support to any location of Policies
2 parents d2c0604 + ed8565d commit 9ac22e8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/GatesServiceProvider.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ protected function loadGates()
3939

4040
$files = ! empty($paths) ? (new Finder)->in($paths)->files() : [];
4141

42-
$namespace = $this->app->getNamespace();
43-
4442
collect($files)
45-
->map(function ($file) use ($namespace) {
46-
return $namespace.str_replace(
43+
->map(function ($file) {
44+
return str_replace(
4745
['/', '.php'],
4846
['\\', ''],
49-
Str::after($file->getPathname(), realpath(app_path()).DIRECTORY_SEPARATOR)
47+
Str::ucfirst(Str::after($file->getPathname(), realpath(base_path()).DIRECTORY_SEPARATOR))
5048
);
5149
})
5250
->merge(config('gates.classes'))

0 commit comments

Comments
 (0)