@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'name' => 'Name', |
|
5 | - 'guard_name' => 'Guard Name', |
|
6 | - 'created_at' => 'Created at', |
|
7 | - 'updated_at' => 'Updated at', |
|
4 | + 'name' => 'Name', |
|
5 | + 'guard_name' => 'Guard Name', |
|
6 | + 'created_at' => 'Created at', |
|
7 | + 'updated_at' => 'Updated at', |
|
8 | 8 | ]; |
9 | 9 | \ No newline at end of file |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'Roles' => 'Roles', |
|
5 | - 'Role' => 'Role', |
|
6 | - 'Permissions' => 'Permissions', |
|
7 | - 'Permission' => 'Permission', |
|
4 | + 'Roles' => 'Roles', |
|
5 | + 'Role' => 'Role', |
|
6 | + 'Permissions' => 'Permissions', |
|
7 | + 'Permission' => 'Permission', |
|
8 | 8 | ]; |
9 | 9 | \ No newline at end of file |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'name' => 'Name', |
|
5 | - 'display_name' => 'Display Name', |
|
6 | - 'guard_name' => 'Guard Name', |
|
7 | - 'created_at' => 'Created at', |
|
8 | - 'updated_at' => 'Updated at', |
|
4 | + 'name' => 'Name', |
|
5 | + 'display_name' => 'Display Name', |
|
6 | + 'guard_name' => 'Guard Name', |
|
7 | + 'created_at' => 'Created at', |
|
8 | + 'updated_at' => 'Updated at', |
|
9 | 9 | ]; |
10 | 10 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'sidebar-label' => 'Roles & Permissions', |
|
4 | + 'sidebar-label' => 'Roles & Permissions', |
|
5 | 5 | ]; |
6 | 6 | \ No newline at end of file |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | class Permission extends Resource |
9 | 9 | { |
10 | - use PermissionResourceTrait,TranslationHandelTrait { |
|
10 | + use PermissionResourceTrait, TranslationHandelTrait { |
|
11 | 11 | TranslationHandelTrait::applyFilters insteadof PermissionResourceTrait; |
12 | 12 | } |
13 | 13 |
@@ -8,8 +8,8 @@ |
||
8 | 8 | class Permission extends Resource |
9 | 9 | { |
10 | 10 | use PermissionResourceTrait,TranslationHandelTrait { |
11 | - TranslationHandelTrait::applyFilters insteadof PermissionResourceTrait; |
|
12 | - } |
|
11 | + TranslationHandelTrait::applyFilters insteadof PermissionResourceTrait; |
|
12 | + } |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * The model the resource corresponds to. |
@@ -40,7 +40,7 @@ |
||
40 | 40 | public static function getGuardForModel(string $model) { |
41 | 41 | |
42 | 42 | return collect(config('auth.guards')) |
43 | - ->map(function ($guard) { |
|
43 | + ->map(function($guard) { |
|
44 | 44 | return config("auth.providers.{$guard['provider']}.model"); |
45 | 45 | })->search($model); |
46 | 46 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function fields(Request $request) |
32 | 32 | { |
33 | - $guardOptions = collect(config('auth.guards'))->mapWithKeys(function ($value, $key) { |
|
33 | + $guardOptions = collect(config('auth.guards'))->mapWithKeys(function($value, $key) { |
|
34 | 34 | return [$key => $key]; |
35 | 35 | }); |
36 | 36 | |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | ->creationRules('unique:' . config('permission.table_names.permissions')) |
47 | 47 | ->updateRules('unique:' . config('permission.table_names.permissions') . ',name,{{resourceId}}'), |
48 | 48 | |
49 | - Text::make(__('laravel-nova-permission::permissions.display_name'),function (){ |
|
50 | - return __('laravel-nova-permission::permissions.display_names.'.$this->name); |
|
51 | - })->canSee(function (){ |
|
49 | + Text::make(__('laravel-nova-permission::permissions.display_name'), function() { |
|
50 | + return __('laravel-nova-permission::permissions.display_names.' . $this->name); |
|
51 | + })->canSee(function() { |
|
52 | 52 | return is_array(__('laravel-nova-permission::permissions.display_names')); |
53 | 53 | }), |
54 | 54 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function title() { |
73 | 73 | |
74 | - return __('laravel-nova-permission::permissions.display_names.'.$this->name); |
|
74 | + return __('laravel-nova-permission::permissions.display_names.' . $this->name); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -83,18 +83,18 @@ discard block |
||
83 | 83 | */ |
84 | 84 | protected static function applySearch($query, $search) |
85 | 85 | { |
86 | - $trans_search = array_keys(preg_grep("/$search/",array_dot(__('laravel-nova-permission::permissions.display_names')))); |
|
86 | + $trans_search = array_keys(preg_grep("/$search/", array_dot(__('laravel-nova-permission::permissions.display_names')))); |
|
87 | 87 | |
88 | 88 | if (is_numeric($search) && in_array($query->getModel()->getKeyType(), ['int', 'integer'])) { |
89 | 89 | $query->whereKey($search); |
90 | 90 | } |
91 | 91 | |
92 | - return $query->where(function ($query) use ($trans_search) { |
|
92 | + return $query->where(function($query) use ($trans_search) { |
|
93 | 93 | $model = $query->getModel(); |
94 | 94 | |
95 | 95 | foreach (static::searchableColumns() as $column) { |
96 | - foreach ($trans_search as $search){ |
|
97 | - $query->orWhere($model->qualifyColumn($column), 'like', '%'.$search.'%'); |
|
96 | + foreach ($trans_search as $search) { |
|
97 | + $query->orWhere($model->qualifyColumn($column), 'like', '%' . $search . '%'); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | }); |
@@ -8,8 +8,8 @@ |
||
8 | 8 | class Role extends Resource |
9 | 9 | { |
10 | 10 | use RoleResourceTrait, TranslationHandelTrait { |
11 | - TranslationHandelTrait::applyFilters insteadof RoleResourceTrait; |
|
12 | - } |
|
11 | + TranslationHandelTrait::applyFilters insteadof RoleResourceTrait; |
|
12 | + } |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * The model the resource corresponds to. |
@@ -12,10 +12,10 @@ |
||
12 | 12 | public function boot() |
13 | 13 | { |
14 | 14 | $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laravel-nova-permission'); |
15 | - $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'laravel-nova-permission'); |
|
15 | + $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'laravel-nova-permission'); |
|
16 | 16 | |
17 | 17 | $this->publishes([ |
18 | - __DIR__.'/../resources/lang' => resource_path('lang/vendor/laravel-nova-permission'), |
|
18 | + __DIR__ . '/../resources/lang' => resource_path('lang/vendor/laravel-nova-permission'), |
|
19 | 19 | ], 'laravel-nova-permission-lang'); |
20 | 20 | } |
21 | 21 |