@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @param $permission |
14 | 14 | * |
15 | - * @return true |
|
15 | + * @return boolean|null |
|
16 | 16 | */ |
17 | 17 | public static function check($permission) |
18 | 18 | { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @param $roles |
40 | 40 | * |
41 | - * @return true |
|
41 | + * @return boolean|null |
|
42 | 42 | */ |
43 | 43 | public static function allow($roles) |
44 | 44 | { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param $roles |
68 | 68 | * |
69 | - * @return true |
|
69 | + * @return boolean|null |
|
70 | 70 | */ |
71 | 71 | public static function deny($roles) |
72 | 72 | { |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Auth; |
4 | 4 | |
5 | -use Encore\Admin\Facades\Admin; |
|
5 | +use Encore\Admin\Facades\Admin; |
|
6 | 6 | use Encore\Admin\Middleware\Pjax; |
7 | 7 | |
8 | 8 | class Permission |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | if (is_array($permission)) { |
24 | - collect($permission)->each(function ($permission) { |
|
24 | + collect($permission)->each(function($permission) { |
|
25 | 25 | call_user_func([self::class, 'check'], $permission); |
26 | 26 | }); |
27 | 27 |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Console; |
4 | 4 | |
5 | -use Illuminate\Console\GeneratorCommand; |
|
5 | +use Illuminate\Console\GeneratorCommand; |
|
6 | 6 | use Illuminate\Support\Str; |
7 | 7 | |
8 | 8 | class ActionCommand extends GeneratorCommand |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Console; |
4 | 4 | |
5 | -use Illuminate\Console\Command; |
|
6 | -use Illuminate\Filesystem\Filesystem; |
|
5 | +use Illuminate\Console\Command; |
|
6 | +use Illuminate\Filesystem\Filesystem; |
|
7 | 7 | use Illuminate\Support\Str; |
8 | 8 | |
9 | 9 | class ExtendCommand extends Command |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Console; |
4 | 4 | |
5 | -use Encore\Admin\Admin; |
|
6 | -use Illuminate\Console\Command; |
|
5 | +use Encore\Admin\Admin; |
|
6 | +use Illuminate\Console\Command; |
|
7 | 7 | use Illuminate\Support\Arr; |
8 | 8 | |
9 | 9 | class ImportCommand extends Command |
@@ -35,7 +35,7 @@ |
||
35 | 35 | /** |
36 | 36 | * Execute the console command. |
37 | 37 | * |
38 | - * @return void |
|
38 | + * @return false|null |
|
39 | 39 | */ |
40 | 40 | public function handle() |
41 | 41 | { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Console; |
4 | 4 | |
5 | -use Illuminate\Console\GeneratorCommand; |
|
6 | -use Illuminate\Database\Eloquent\Model; |
|
5 | +use Illuminate\Console\GeneratorCommand; |
|
6 | +use Illuminate\Database\Eloquent\Model; |
|
7 | 7 | use Illuminate\Support\Str; |
8 | 8 | |
9 | 9 | class MakeCommand extends GeneratorCommand |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Console; |
4 | 4 | |
5 | -use Encore\Admin\Facades\Admin; |
|
5 | +use Encore\Admin\Facades\Admin; |
|
6 | 6 | use Illuminate\Console\Command; |
7 | 7 | |
8 | 8 | class MenuCommand extends Command |
@@ -2,10 +2,10 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Console; |
4 | 4 | |
5 | -use Encore\Admin\Admin; |
|
6 | -use Encore\Admin\Facades\Admin as AdminFacade; |
|
7 | -use Illuminate\Console\Command; |
|
8 | -use Illuminate\Support\Str; |
|
5 | +use Encore\Admin\Admin; |
|
6 | +use Encore\Admin\Facades\Admin as AdminFacade; |
|
7 | +use Illuminate\Console\Command; |
|
8 | +use Illuminate\Support\Str; |
|
9 | 9 | use MatthiasMullie\Minify; |
10 | 10 | |
11 | 11 | class MinifyCommand extends Command |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | protected function minifyCSS() |
95 | 95 | { |
96 | 96 | $css = collect(array_merge(Admin::$css, Admin::baseCss())) |
97 | - ->unique()->map(function ($css) { |
|
97 | + ->unique()->map(function($css) { |
|
98 | 98 | if (url()->isValidUrl($css)) { |
99 | 99 | $this->assets['css'][] = $css; |
100 | 100 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | protected function minifyJS() |
125 | 125 | { |
126 | 126 | $js = collect(array_merge(Admin::$js, Admin::baseJs())) |
127 | - ->unique()->map(function ($js) { |
|
127 | + ->unique()->map(function($js) { |
|
128 | 128 | if (url()->isValidUrl($js)) { |
129 | 129 | $this->assets['js'][] = $js; |
130 | 130 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | protected function generateManifest() |
155 | 155 | { |
156 | - $min = collect(Admin::$min)->mapWithKeys(function ($path, $type) { |
|
156 | + $min = collect(Admin::$min)->mapWithKeys(function($path, $type) { |
|
157 | 157 | return [$type => sprintf('%s?id=%s', $path, md5(uniqid()))]; |
158 | 158 | }); |
159 | 159 |
@@ -112,6 +112,9 @@ discard block |
||
112 | 112 | ]; |
113 | 113 | } |
114 | 114 | |
115 | + /** |
|
116 | + * @param string $permission |
|
117 | + */ |
|
115 | 118 | private function generateHttpMethod($permission) |
116 | 119 | { |
117 | 120 | switch ($permission) { |
@@ -134,6 +137,9 @@ discard block |
||
134 | 137 | return $http_method; |
135 | 138 | } |
136 | 139 | |
140 | + /** |
|
141 | + * @param string $permission |
|
142 | + */ |
|
137 | 143 | private function generateHttpPath($table, $permission) |
138 | 144 | { |
139 | 145 | $resource = Str::kebab(Str::camel($table)); |
@@ -160,6 +166,9 @@ discard block |
||
160 | 166 | return $http_path; |
161 | 167 | } |
162 | 168 | |
169 | + /** |
|
170 | + * @param string $permission |
|
171 | + */ |
|
163 | 172 | private function generateSlug($table, $permission) |
164 | 173 | { |
165 | 174 | return Str::kebab(Str::camel($table)).'.'.$permission; |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Console; |
4 | 4 | |
5 | -use Encore\Admin\Auth\Database\Permission; |
|
6 | -use Illuminate\Console\Command; |
|
7 | -use Illuminate\Support\Facades\DB; |
|
5 | +use Encore\Admin\Auth\Database\Permission; |
|
6 | +use Illuminate\Console\Command; |
|
7 | +use Illuminate\Support\Facades\DB; |
|
8 | 8 | use Illuminate\Support\Str; |
9 | 9 | |
10 | 10 | class PermissionCommand extends Command |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Encore\Admin\Controllers; |
4 | 4 | |
5 | -use Encore\Admin\Layout\Content; |
|
5 | +use Encore\Admin\Layout\Content; |
|
6 | 6 | use Illuminate\Routing\Controller; |
7 | 7 | |
8 | 8 | class AdminController extends Controller |