-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRootServiceProvider.stub
46 lines (39 loc) · 999 Bytes
/
RootServiceProvider.stub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace {{ namespace }}Providers;
use {{ namespace }}Models\User;
use {{ namespace }}Root\Resources\UserResource;
use Cone\Root\Interfaces\Models\User as UserInterface;
use Cone\Root\Root;
use Cone\Root\Widgets\Welcome;
use Illuminate\Support\ServiceProvider;
class RootServiceProvider extends ServiceProvider
{
/**
* All of the container bindings that should be registered.
*/
public array $bindings = [
UserInterface::class => User::class,
];
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Gate::define('viewRoot', static function (User $user): bool {
return false;
});
Root::instance()->resources->register([
new UserResource(),
]);
Root::instance()->widgets->register([
new Welcome(),
]);
}
}