Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit c4b6ae9

Browse files
committed
update spatie/laravel-permission version
1 parent 4c766f7 commit c4b6ae9

File tree

2 files changed

+50
-51
lines changed

2 files changed

+50
-51
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"illuminate/support": "~5.5.0|~5.6.0",
2424
"gazsp/baum": "^1.1",
2525
"mcamara/laravel-localization": "^1.3",
26-
"spatie/laravel-permission": "^2.5",
26+
"spatie/laravel-permission": "^2.0",
2727
"spatie/laravel-translatable": "^2.0",
2828
"codezero/laravel-unique-translation": "^1.1",
2929
"ctf0/package-changelog": "^1.0"

src/SimpleMenuServiceProvider.php

+49-50
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ public function boot()
2424
$this->file = app('files');
2525

2626
$this->packagePublish();
27+
$this->observers();
28+
$this->macros();
29+
$this->viewComp();
2730
$this->app['simplemenu'];
2831

2932
// append extra data
@@ -65,56 +68,6 @@ protected function packagePublish()
6568
$this->publishes([
6669
__DIR__ . '/resources/views' => resource_path('views/vendor/SimpleMenu'),
6770
], 'views');
68-
69-
$this->observers();
70-
$this->macros();
71-
$this->viewComp();
72-
}
73-
74-
/**
75-
* [autoReg description].
76-
*
77-
* @return [type] [description]
78-
*/
79-
protected function autoReg()
80-
{
81-
// routes
82-
$route_file = base_path('routes/web.php');
83-
$search = 'SimpleMenu';
84-
85-
if ($this->checkExist($route_file, $search)) {
86-
$data = "\n// SimpleMenu\nSimpleMenu::menuRoutes();";
87-
88-
$this->file->append($route_file, $data);
89-
}
90-
91-
// mix
92-
$mix_file = base_path('webpack.mix.js');
93-
$search = 'SimpleMenu';
94-
95-
if ($this->checkExist($mix_file, $search)) {
96-
$data = "\n// SimpleMenu\nmix.sass('resources/assets/vendor/SimpleMenu/sass/style.scss', 'public/assets/vendor/SimpleMenu/style.css').version();";
97-
98-
$this->file->append($mix_file, $data);
99-
}
100-
101-
// run check once
102-
app('cache')->store('file')->rememberForever('ct-sm', function () {
103-
return 'added';
104-
});
105-
}
106-
107-
/**
108-
* [checkExist description].
109-
*
110-
* @param [type] $file [description]
111-
* @param [type] $search [description]
112-
*
113-
* @return [type] [description]
114-
*/
115-
protected function checkExist($file, $search)
116-
{
117-
return $this->file->exists($file) && !str_contains($this->file->get($file), $search);
11871
}
11972

12073
/**
@@ -168,6 +121,52 @@ protected function viewComp()
168121
});
169122
}
170123

124+
/**
125+
* [autoReg description].
126+
*
127+
* @return [type] [description]
128+
*/
129+
protected function autoReg()
130+
{
131+
// routes
132+
$route_file = base_path('routes/web.php');
133+
$search = 'SimpleMenu';
134+
135+
if ($this->checkExist($route_file, $search)) {
136+
$data = "\n// SimpleMenu\nSimpleMenu::menuRoutes();";
137+
138+
$this->file->append($route_file, $data);
139+
}
140+
141+
// mix
142+
$mix_file = base_path('webpack.mix.js');
143+
$search = 'SimpleMenu';
144+
145+
if ($this->checkExist($mix_file, $search)) {
146+
$data = "\n// SimpleMenu\nmix.sass('resources/assets/vendor/SimpleMenu/sass/style.scss', 'public/assets/vendor/SimpleMenu/style.css').version();";
147+
148+
$this->file->append($mix_file, $data);
149+
}
150+
151+
// run check once
152+
app('cache')->store('file')->rememberForever('ct-sm', function () {
153+
return 'added';
154+
});
155+
}
156+
157+
/**
158+
* [checkExist description].
159+
*
160+
* @param [type] $file [description]
161+
* @param [type] $search [description]
162+
*
163+
* @return [type] [description]
164+
*/
165+
protected function checkExist($file, $search)
166+
{
167+
return $this->file->exists($file) && !str_contains($this->file->get($file), $search);
168+
}
169+
171170
/**
172171
* Register any package services.
173172
*/

0 commit comments

Comments
 (0)