|
1
|
|
|
<?php |
|
2
|
|
|
namespace Xetaravel\Providers; |
|
3
|
|
|
|
|
4
|
|
|
use Collective\Html\FormFacade as Form; |
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
|
6
|
|
|
use Spatie\Menu\Laravel\MenuFacade as Menu; |
|
7
|
|
|
use Spatie\Menu\Laravel\Link; |
|
8
|
|
|
|
|
9
|
|
|
class BootstrapServiceProvider extends ServiceProvider |
|
10
|
|
|
{ |
|
11
|
|
|
/** |
|
12
|
|
|
* Bootstrap any application services. |
|
13
|
|
|
* |
|
14
|
|
|
* @return void |
|
15
|
|
|
*/ |
|
16
|
|
|
public function boot() |
|
17
|
|
|
{ |
|
18
|
|
|
// Spatie Menu |
|
19
|
|
|
Menu::macro('userProfile', function () { |
|
20
|
|
|
return Menu::new() |
|
21
|
|
|
->addClass('nav nav-menu flex-column') |
|
22
|
|
|
->setAttribute('role', 'navigation') |
|
23
|
|
|
->add( |
|
24
|
|
|
Link::toRoute('users.account.index', '<i class="fa fa-user"></i> Account') |
|
25
|
|
|
->addClass('nav-link') |
|
26
|
|
|
) |
|
27
|
|
|
->add( |
|
28
|
|
|
Link::toRoute('users.notification.index', '<i class="fa fa-bell-o"></i> Notifications') |
|
29
|
|
|
->addClass('nav-link') |
|
30
|
|
|
) |
|
31
|
|
|
->setActiveFromRequest(); |
|
32
|
|
|
}); |
|
33
|
|
|
|
|
34
|
|
|
// Collective Form |
|
35
|
|
|
Form::component( |
|
36
|
|
|
'bsText', |
|
37
|
|
|
'components.form.text', |
|
38
|
|
|
['name', 'label' => null, 'value' => null, 'attributes' => []] |
|
39
|
|
|
); |
|
40
|
|
|
Form::component( |
|
41
|
|
|
'bsEmail', |
|
42
|
|
|
'components.form.email', |
|
43
|
|
|
['name', 'label' => null, 'value' => null, 'attributes' => []] |
|
44
|
|
|
); |
|
45
|
|
|
Form::component( |
|
46
|
|
|
'bsTextarea', |
|
47
|
|
|
'components.form.textarea', |
|
48
|
|
|
['name', 'label' => null, 'value' => null, 'attributes' => []] |
|
49
|
|
|
); |
|
50
|
|
|
Form::component('bsPassword', 'components.form.password', ['name', 'label' => null, 'attributes' => []]); |
|
51
|
|
|
Form::component('bsCheckbox', 'components.form.checkbox', [ |
|
52
|
|
|
'name', |
|
53
|
|
|
'value' => 1, |
|
54
|
|
|
'checked' => null, |
|
55
|
|
|
'label' => null, |
|
56
|
|
|
'attributes' => [] |
|
57
|
|
|
]); |
|
58
|
|
|
Form::component( |
|
59
|
|
|
'bsInputGroup', |
|
60
|
|
|
'components.form.input-group', |
|
61
|
|
|
['name', 'label' => null, 'value' => null, 'attributes' => []] |
|
62
|
|
|
); |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|