Skip to content

Commit 2a78a9b

Browse files
committed
refactor: small fixes
1 parent 98a1a87 commit 2a78a9b

File tree

5 files changed

+27
-305
lines changed

5 files changed

+27
-305
lines changed

config/acl.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
return [
44

5-
/*
6-
|--------------------------------------------------------------------------
7-
| Roles
8-
|--------------------------------------------------------------------------
9-
*/
10-
'roles' => [
11-
'entity' => App\Entities\Role::class,
12-
],
135
/*
146
|--------------------------------------------------------------------------
157
| Permissions
@@ -24,6 +16,17 @@
2416
'entity' => LaravelDoctrine\ACL\Permissions\Permission::class,
2517
'list' => [],
2618
],
19+
20+
21+
/*
22+
|--------------------------------------------------------------------------
23+
| Roles
24+
|--------------------------------------------------------------------------
25+
*/
26+
'roles' => [
27+
'entity' => App\Entities\Role::class,
28+
],
29+
2730
/*
2831
|--------------------------------------------------------------------------
2932
| Organisations

src/AclServiceProvider.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010
use LaravelDoctrine\ACL\Mappings\RegisterMappedEventSubscribers;
1111
use LaravelDoctrine\ORM\DoctrineManager;
1212

13+
use function config_path;
14+
1315
use const DIRECTORY_SEPARATOR;
1416

1517
class AclServiceProvider extends ServiceProvider
1618
{
19+
public function boot(): void
20+
{
21+
$this->publishConfig();
22+
}
23+
1724
public function register(): void
1825
{
1926
$this->mergeConfig();
@@ -56,6 +63,13 @@ protected function registerGatePermissions(): void
5663
});
5764
}
5865

66+
protected function publishConfig(): void
67+
{
68+
$this->publishes([
69+
$this->getConfigPath() => config_path('acl.php'),
70+
], 'config');
71+
}
72+
5973
protected function mergeConfig(): void
6074
{
6175
$this->mergeConfigFrom(

src/Permissions/Driver/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class Config implements PermissionDriver
1111
protected Collection $collection;
1212

1313
/** @var array<string> */
14-
public function __construct(protected array $permissions)
14+
public function __construct(array $permissions)
1515
{
16-
$this->collection = new Collection($this->permissions);
16+
$this->collection = new Collection($permissions);
1717
}
1818

1919
public function getAllPermissions(): Collection

workbench/bootstrap/cache/packages.php

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)