@@ -104,7 +104,7 @@ |
||
104 | 104 | { |
105 | 105 | $uid = auth('cbAdmin')->user()->id_cms_privileges; |
106 | 106 | |
107 | - return cache()->rememberForever('cb_admin_privileges_roles', function () use ($uid) { |
|
107 | + return cache()->rememberForever('cb_admin_privileges_roles', function() use ($uid) { |
|
108 | 108 | return \DB::table('cms_privileges_roles')->where('id_cms_privileges', $uid)->join('cms_modules', 'cms_modules.id', '=', 'id_cms_modules')->select('cms_modules.name', 'cms_modules.path', 'can_see_module', 'can_create', 'can_read', 'can_edit', 'can_delete')->get() ?: []; |
109 | 109 | }); |
110 | 110 | } |
@@ -5,36 +5,36 @@ |
||
5 | 5 | |
6 | 6 | class CreateCmsPrivilegesRolesTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('cms_privileges_roles', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->increments('id'); |
|
18 | - $table->boolean('can_see_module')->nullable(); |
|
19 | - $table->boolean('can_create')->nullable(); |
|
20 | - $table->boolean('can_read')->nullable(); |
|
21 | - $table->boolean('can_edit')->nullable(); |
|
22 | - $table->boolean('can_delete')->nullable(); |
|
23 | - $table->integer('id_cms_privileges')->nullable(); |
|
24 | - $table->integer('id_cms_modules')->nullable(); |
|
25 | - $table->timestamps(); |
|
26 | - }); |
|
27 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('cms_privileges_roles', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->increments('id'); |
|
18 | + $table->boolean('can_see_module')->nullable(); |
|
19 | + $table->boolean('can_create')->nullable(); |
|
20 | + $table->boolean('can_read')->nullable(); |
|
21 | + $table->boolean('can_edit')->nullable(); |
|
22 | + $table->boolean('can_delete')->nullable(); |
|
23 | + $table->integer('id_cms_privileges')->nullable(); |
|
24 | + $table->integer('id_cms_modules')->nullable(); |
|
25 | + $table->timestamps(); |
|
26 | + }); |
|
27 | + } |
|
28 | 28 | |
29 | 29 | |
30 | - /** |
|
31 | - * Reverse the migrations. |
|
32 | - * |
|
33 | - * @return void |
|
34 | - */ |
|
35 | - public function down() |
|
36 | - { |
|
37 | - Schema::drop('cms_privileges_roles'); |
|
38 | - } |
|
30 | + /** |
|
31 | + * Reverse the migrations. |
|
32 | + * |
|
33 | + * @return void |
|
34 | + */ |
|
35 | + public function down() |
|
36 | + { |
|
37 | + Schema::drop('cms_privileges_roles'); |
|
38 | + } |
|
39 | 39 | |
40 | 40 | } |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | __DIR__.'/CBCoreModule/publieshed_files/readme.txt' => resource_path('views/vendor/crudbooster/type_components/readme.txt'), |
56 | 56 | ], 'cb_type_components'); |
57 | 57 | |
58 | - if (! file_exists(app_path('Http/Controllers/AdminUsersController.php'))) { |
|
58 | + if (!file_exists(app_path('Http/Controllers/AdminUsersController.php'))) { |
|
59 | 59 | $this->publishes([__DIR__.'/CBCoreModule/publieshed_files/AdminUsersController.php' => app_path('Http/Controllers/AdminUsersController.php')], 'cb_user_controller'); |
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | $this->defineValidationRules(); |
64 | - $this->loadRoutesFrom( __DIR__.'/routes.php'); |
|
64 | + $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $this->mergeConfigFrom(__DIR__.'/configs/crudbooster.php', 'crudbooster'); |
75 | 75 | |
76 | - $this->app->singleton('crudbooster', function () { |
|
76 | + $this->app->singleton('crudbooster', function() { |
|
77 | 77 | return true; |
78 | 78 | }); |
79 | 79 | |
@@ -114,14 +114,14 @@ discard block |
||
114 | 114 | |
115 | 115 | private function registerCrudboosterCommand() |
116 | 116 | { |
117 | - $this->app->singleton('crudboosterinstall', function () { |
|
117 | + $this->app->singleton('crudboosterinstall', function() { |
|
118 | 118 | return new CrudboosterInstallationCommand; |
119 | 119 | }); |
120 | 120 | } |
121 | 121 | |
122 | 122 | private function defineValidationRules() |
123 | 123 | { |
124 | - \Validator::extend('alpha_spaces', function ($attribute, $value) { |
|
124 | + \Validator::extend('alpha_spaces', function($attribute, $value) { |
|
125 | 125 | // This will only accept alpha and spaces. |
126 | 126 | // If you want to accept hyphens use: /^[\pL\s-]+$/u. |
127 | 127 | return preg_match('/^[\pL\s]+$/u', $value); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | private function defineAuthGuard() |
132 | 132 | { |
133 | - config()->offsetSet('auth.providers.cb_users', ['driver' => 'eloquent', 'model' => CbUser::class,]); |
|
133 | + config()->offsetSet('auth.providers.cb_users', ['driver' => 'eloquent', 'model' => CbUser::class, ]); |
|
134 | 134 | config()->offsetSet('auth.guards.cbAdmin', ['driver' => 'session', 'provider' => 'cb_users']); |
135 | 135 | } |
136 | 136 | } |