|
1
|
|
|
<?php namespace Arcanesoft\Auth\Providers; |
|
2
|
|
|
|
|
3
|
|
|
use Arcanedev\Support\Providers\ViewComposerServiceProvider as ServiceProvider; |
|
4
|
|
|
use Arcanesoft\Auth\ViewComposers; |
|
5
|
|
|
use Arcanesoft\Auth\ViewComposers\Dashboard; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Class ViewComposerServiceProvider |
|
9
|
|
|
* |
|
10
|
|
|
* @package Arcanesoft\Auth\Providers |
|
11
|
|
|
* @author ARCANEDEV <[email protected]> |
|
12
|
|
|
*/ |
|
13
|
|
|
class ViewComposerServiceProvider extends ServiceProvider |
|
14
|
|
|
{ |
|
15
|
|
|
/* ----------------------------------------------------------------- |
|
16
|
|
|
| Properties |
|
17
|
|
|
| ----------------------------------------------------------------- |
|
18
|
|
|
*/ |
|
19
|
|
|
/** |
|
20
|
|
|
* Register the composer classes. |
|
21
|
|
|
* |
|
22
|
|
|
* @var array |
|
23
|
|
|
*/ |
|
24
|
|
|
protected $composerClasses = [ |
|
25
|
|
|
// Dashboard view composers |
|
26
|
|
|
Dashboard\UsersCountComposer::VIEW => Dashboard\UsersCountComposer::class, |
|
27
|
|
|
Dashboard\RolesCountComposer::VIEW => Dashboard\RolesCountComposer::class, |
|
28
|
|
|
Dashboard\PermissionsCountComposer::VIEW => Dashboard\PermissionsCountComposer::class, |
|
29
|
|
|
Dashboard\LatestThirtyDaysCreatedUsersComposer::VIEW => Dashboard\LatestThirtyDaysCreatedUsersComposer::class, |
|
30
|
|
|
Dashboard\OnlineUsersCountComposer::VIEW => Dashboard\OnlineUsersCountComposer::class, |
|
31
|
|
|
]; |
|
32
|
|
|
|
|
33
|
|
|
/* ----------------------------------------------------------------- |
|
34
|
|
|
| Main Functions |
|
35
|
|
|
| ----------------------------------------------------------------- |
|
36
|
|
|
*/ |
|
37
|
|
|
/** |
|
38
|
|
|
* {@inheritdoc} |
|
39
|
|
|
*/ |
|
40
|
12 |
|
public function boot() |
|
41
|
|
|
{ |
|
42
|
12 |
|
parent::boot(); |
|
43
|
|
|
|
|
44
|
12 |
|
$this->registerOtherComposers(); |
|
45
|
12 |
|
} |
|
46
|
|
|
|
|
47
|
|
|
/* ----------------------------------------------------------------- |
|
48
|
|
|
| Other Functions |
|
49
|
|
|
| ----------------------------------------------------------------- |
|
50
|
|
|
*/ |
|
51
|
|
|
/** |
|
52
|
|
|
* Register other view composers. |
|
53
|
|
|
*/ |
|
54
|
12 |
|
private function registerOtherComposers() |
|
55
|
|
|
{ |
|
56
|
12 |
|
$this->composer( |
|
57
|
12 |
|
'auth::admin.roles._partials.permissions-checkbox', |
|
58
|
6 |
|
'Arcanesoft\Auth\ViewComposers\PermissionsComposer@composeRolePermissions' |
|
59
|
6 |
|
); |
|
60
|
|
|
|
|
61
|
12 |
|
$this->composer( |
|
62
|
12 |
|
'auth::admin.users.list', |
|
63
|
6 |
|
'Arcanesoft\Auth\ViewComposers\RolesComposer@composeFilters' |
|
64
|
6 |
|
); |
|
65
|
|
|
|
|
66
|
12 |
|
$this->composer( |
|
67
|
12 |
|
ViewComposers\PermissionGroupsFilterComposer::VIEW, |
|
68
|
6 |
|
ViewComposers\PermissionGroupsFilterComposer::class |
|
69
|
6 |
|
); |
|
70
|
12 |
|
} |
|
71
|
|
|
} |
|
72
|
|
|
|