@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreatePasswordResetsTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('password_resets', function (Blueprint $table) { |
|
| 17 | - $table->string('email')->index(); |
|
| 18 | - $table->string('token'); |
|
| 19 | - $table->timestamp('created_at')->nullable(); |
|
| 20 | - }); |
|
| 21 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('password_resets', function (Blueprint $table) { |
|
| 17 | + $table->string('email')->index(); |
|
| 18 | + $table->string('token'); |
|
| 19 | + $table->timestamp('created_at')->nullable(); |
|
| 20 | + }); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Reverse the migrations. |
|
| 25 | - * |
|
| 26 | - * @return void |
|
| 27 | - */ |
|
| 28 | - public function down() |
|
| 29 | - { |
|
| 30 | - Schema::dropIfExists('password_resets'); |
|
| 31 | - } |
|
| 23 | + /** |
|
| 24 | + * Reverse the migrations. |
|
| 25 | + * |
|
| 26 | + * @return void |
|
| 27 | + */ |
|
| 28 | + public function down() |
|
| 29 | + { |
|
| 30 | + Schema::dropIfExists('password_resets'); |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('password_resets', function (Blueprint $table) { |
|
| 16 | + Schema::create('password_resets', function(Blueprint $table) { |
|
| 17 | 17 | $table->string('email')->index(); |
| 18 | 18 | $table->string('token'); |
| 19 | 19 | $table->timestamp('created_at')->nullable(); |
@@ -6,31 +6,31 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateUsersTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - Schema::create('users', function (Blueprint $table) { |
|
| 17 | - $table->bigIncrements('id'); |
|
| 18 | - $table->string('name'); |
|
| 19 | - $table->string('email')->unique(); |
|
| 20 | - $table->timestamp('email_verified_at')->nullable(); |
|
| 21 | - $table->string('password'); |
|
| 22 | - $table->rememberToken(); |
|
| 23 | - $table->timestamps(); |
|
| 24 | - }); |
|
| 25 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + Schema::create('users', function (Blueprint $table) { |
|
| 17 | + $table->bigIncrements('id'); |
|
| 18 | + $table->string('name'); |
|
| 19 | + $table->string('email')->unique(); |
|
| 20 | + $table->timestamp('email_verified_at')->nullable(); |
|
| 21 | + $table->string('password'); |
|
| 22 | + $table->rememberToken(); |
|
| 23 | + $table->timestamps(); |
|
| 24 | + }); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Reverse the migrations. |
|
| 29 | - * |
|
| 30 | - * @return void |
|
| 31 | - */ |
|
| 32 | - public function down() |
|
| 33 | - { |
|
| 34 | - Schema::dropIfExists('users'); |
|
| 35 | - } |
|
| 27 | + /** |
|
| 28 | + * Reverse the migrations. |
|
| 29 | + * |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | + public function down() |
|
| 33 | + { |
|
| 34 | + Schema::dropIfExists('users'); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('users', function (Blueprint $table) { |
|
| 16 | + Schema::create('users', function(Blueprint $table) { |
|
| 17 | 17 | $table->bigIncrements('id'); |
| 18 | 18 | $table->string('name'); |
| 19 | 19 | $table->string('email')->unique(); |
@@ -7,14 +7,14 @@ |
||
| 7 | 7 | |
| 8 | 8 | class UserAccessServiceProvider extends ServiceProvider |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Booting the package. |
|
| 12 | - */ |
|
| 13 | - public function boot() |
|
| 14 | - { |
|
| 15 | - // allow Super Admin full access |
|
| 16 | - Gate::after(function ($user, $ability) { |
|
| 17 | - return $user->hasRole('Super Admin'); |
|
| 18 | - }); |
|
| 19 | - } |
|
| 10 | + /** |
|
| 11 | + * Booting the package. |
|
| 12 | + */ |
|
| 13 | + public function boot() |
|
| 14 | + { |
|
| 15 | + // allow Super Admin full access |
|
| 16 | + Gate::after(function ($user, $ability) { |
|
| 17 | + return $user->hasRole('Super Admin'); |
|
| 18 | + }); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function boot() |
| 14 | 14 | { |
| 15 | 15 | // allow Super Admin full access |
| 16 | - Gate::after(function ($user, $ability) { |
|
| 16 | + Gate::after(function($user, $ability) { |
|
| 17 | 17 | return $user->hasRole('Super Admin'); |
| 18 | 18 | }); |
| 19 | 19 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | protected function showEditPermissions() |
| 37 | 37 | { |
| 38 | - $permissionsData = Permission::all(['id', 'name'])->map(function($permission){ |
|
| 38 | + $permissionsData = Permission::all(['id', 'name'])->map(function($permission) { |
|
| 39 | 39 | $permission['name'] = trans(ucwords($permission['name'])); |
| 40 | 40 | |
| 41 | 41 | return $permission; |
@@ -99,19 +99,19 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | protected function columns() |
| 101 | 101 | { |
| 102 | - return $this->columns = $this->columns?: $this->add('Columns'); |
|
| 102 | + return $this->columns = $this->columns ?: $this->add('Columns'); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | protected function permissionId() |
| 106 | 106 | { |
| 107 | - return $this->app->stickyGet($this->columns()->name)?: $this->getModuleVariable('permission'); |
|
| 107 | + return $this->app->stickyGet($this->columns()->name) ?: $this->getModuleVariable('permission'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | protected function reload($permissionExpression = null) |
| 111 | 111 | { |
| 112 | 112 | $columns = $this->columns(); |
| 113 | 113 | |
| 114 | - return $this->reload = $this->reload?: new jsReload($columns, [$columns->name => $permissionExpression?: '']); |
|
| 114 | + return $this->reload = $this->reload ?: new jsReload($columns, [$columns->name => $permissionExpression ?: '']); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | protected function getModel($array) |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | private static function cacheUserVariables() { |
| 26 | - if(isset(self::$userVariables)) return; |
|
| 26 | + if (isset(self::$userVariables)) return; |
|
| 27 | 27 | |
| 28 | 28 | $userId = Auth::user()->id; |
| 29 | 29 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | private static function cacheAdminVariables() { |
| 36 | - if(isset(self::$adminVariables)) return; |
|
| 36 | + if (isset(self::$adminVariables)) return; |
|
| 37 | 37 | |
| 38 | 38 | foreach (self::where('user_id', 0) as $row) { |
| 39 | 39 | self::$adminVariables[$row['group']][$row['name']] = $row['value']; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public static function get($group, $name, $user = null) { |
| 44 | - $user = $user?: Auth::user()->id; |
|
| 44 | + $user = $user ?: Auth::user()->id; |
|
| 45 | 45 | |
| 46 | 46 | if (!$user || !is_numeric($user)) return; |
| 47 | 47 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public static function getGroup($group, $user = null) { |
| 54 | - $user = $user?: Auth::user()->id; |
|
| 54 | + $user = $user ?: Auth::user()->id; |
|
| 55 | 55 | |
| 56 | 56 | if (!$user || !is_numeric($user)) return; |
| 57 | 57 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public static function put($group, $name, $value, $user = null) { |
| 76 | - $user_id = $user?: Auth::user()->id; |
|
| 76 | + $user_id = $user ?: Auth::user()->id; |
|
| 77 | 77 | |
| 78 | 78 | if (!$user_id || !is_numeric($user_id)) return; |
| 79 | 79 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | public static function forget($group, $name, $user = null) { |
| 104 | - $user_id = $user?: Auth::user()->id; |
|
| 104 | + $user_id = $user ?: Auth::user()->id; |
|
| 105 | 105 | |
| 106 | 106 | if (!$user_id || !is_numeric($user_id)) return; |
| 107 | 107 | |
@@ -23,7 +23,9 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | private static function cacheUserVariables() { |
| 26 | - if(isset(self::$userVariables)) return; |
|
| 26 | + if(isset(self::$userVariables)) { |
|
| 27 | + return; |
|
| 28 | + } |
|
| 27 | 29 | |
| 28 | 30 | $userId = Auth::user()->id; |
| 29 | 31 | |
@@ -33,7 +35,9 @@ discard block |
||
| 33 | 35 | } |
| 34 | 36 | |
| 35 | 37 | private static function cacheAdminVariables() { |
| 36 | - if(isset(self::$adminVariables)) return; |
|
| 38 | + if(isset(self::$adminVariables)) { |
|
| 39 | + return; |
|
| 40 | + } |
|
| 37 | 41 | |
| 38 | 42 | foreach (self::where('user_id', 0) as $row) { |
| 39 | 43 | self::$adminVariables[$row['group']][$row['name']] = $row['value']; |
@@ -43,7 +47,9 @@ discard block |
||
| 43 | 47 | public static function get($group, $name, $user = null) { |
| 44 | 48 | $user = $user?: Auth::user()->id; |
| 45 | 49 | |
| 46 | - if (!$user || !is_numeric($user)) return; |
|
| 50 | + if (!$user || !is_numeric($user)) { |
|
| 51 | + return; |
|
| 52 | + } |
|
| 47 | 53 | |
| 48 | 54 | self::cache(); |
| 49 | 55 | |
@@ -53,7 +59,9 @@ discard block |
||
| 53 | 59 | public static function getGroup($group, $user = null) { |
| 54 | 60 | $user = $user?: Auth::user()->id; |
| 55 | 61 | |
| 56 | - if (!$user || !is_numeric($user)) return; |
|
| 62 | + if (!$user || !is_numeric($user)) { |
|
| 63 | + return; |
|
| 64 | + } |
|
| 57 | 65 | |
| 58 | 66 | self::cache(); |
| 59 | 67 | |
@@ -75,7 +83,9 @@ discard block |
||
| 75 | 83 | public static function put($group, $name, $value, $user = null) { |
| 76 | 84 | $user_id = $user?: Auth::user()->id; |
| 77 | 85 | |
| 78 | - if (!$user_id || !is_numeric($user_id)) return; |
|
| 86 | + if (!$user_id || !is_numeric($user_id)) { |
|
| 87 | + return; |
|
| 88 | + } |
|
| 79 | 89 | |
| 80 | 90 | self::cache(); |
| 81 | 91 | |
@@ -103,7 +113,9 @@ discard block |
||
| 103 | 113 | public static function forget($group, $name, $user = null) { |
| 104 | 114 | $user_id = $user?: Auth::user()->id; |
| 105 | 115 | |
| 106 | - if (!$user_id || !is_numeric($user_id)) return; |
|
| 116 | + if (!$user_id || !is_numeric($user_id)) { |
|
| 117 | + return; |
|
| 118 | + } |
|
| 107 | 119 | |
| 108 | 120 | self::cache(); |
| 109 | 121 | |
@@ -6,31 +6,31 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateUserSettingsTable extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - $this->down(); |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + $this->down(); |
|
| 17 | 17 | |
| 18 | - Schema::create('user_settings', function (Blueprint $table) { |
|
| 19 | - $table->increments('id'); |
|
| 20 | - $table->unsignedInteger('user_id'); |
|
| 21 | - $table->string('group', 512); |
|
| 22 | - $table->string('name', 128); |
|
| 23 | - $table->text('value'); |
|
| 24 | - }); |
|
| 25 | - } |
|
| 18 | + Schema::create('user_settings', function (Blueprint $table) { |
|
| 19 | + $table->increments('id'); |
|
| 20 | + $table->unsignedInteger('user_id'); |
|
| 21 | + $table->string('group', 512); |
|
| 22 | + $table->string('name', 128); |
|
| 23 | + $table->text('value'); |
|
| 24 | + }); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Reverse the migrations. |
|
| 29 | - * |
|
| 30 | - * @return void |
|
| 31 | - */ |
|
| 32 | - public function down() |
|
| 33 | - { |
|
| 34 | - Schema::dropIfExists('user_settings'); |
|
| 35 | - } |
|
| 27 | + /** |
|
| 28 | + * Reverse the migrations. |
|
| 29 | + * |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | + public function down() |
|
| 33 | + { |
|
| 34 | + Schema::dropIfExists('user_settings'); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $this->down(); |
| 17 | 17 | |
| 18 | - Schema::create('user_settings', function (Blueprint $table) { |
|
| 18 | + Schema::create('user_settings', function(Blueprint $table) { |
|
| 19 | 19 | $table->increments('id'); |
| 20 | 20 | $table->unsignedInteger('user_id'); |
| 21 | 21 | $table->string('group', 512); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function group() |
| 27 | 27 | { |
| 28 | - return $this->group?: static::class; |
|
| 28 | + return $this->group ?: static::class; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -6,42 +6,42 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateDashboardTables extends Migration |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the migrations. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function up() |
|
| 15 | - { |
|
| 16 | - $this->down(); |
|
| 9 | + /** |
|
| 10 | + * Run the migrations. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function up() |
|
| 15 | + { |
|
| 16 | + $this->down(); |
|
| 17 | 17 | |
| 18 | - Schema::create('dashboards', function (Blueprint $table) { |
|
| 19 | - $table->increments('id'); |
|
| 20 | - $table->unsignedInteger('user_id'); |
|
| 21 | - $table->string('name', 64); |
|
| 22 | - $table->smallInteger('position'); |
|
| 23 | - }); |
|
| 18 | + Schema::create('dashboards', function (Blueprint $table) { |
|
| 19 | + $table->increments('id'); |
|
| 20 | + $table->unsignedInteger('user_id'); |
|
| 21 | + $table->string('name', 64); |
|
| 22 | + $table->smallInteger('position'); |
|
| 23 | + }); |
|
| 24 | 24 | |
| 25 | - Schema::create('dashboard_applets', function (Blueprint $table) { |
|
| 26 | - $table->increments('id'); |
|
| 27 | - $table->unsignedInteger('dashboard_id'); |
|
| 28 | - $table->string('class', 512); |
|
| 29 | - $table->smallInteger('column'); |
|
| 30 | - $table->smallInteger('row'); |
|
| 31 | - $table->text('options'); |
|
| 25 | + Schema::create('dashboard_applets', function (Blueprint $table) { |
|
| 26 | + $table->increments('id'); |
|
| 27 | + $table->unsignedInteger('dashboard_id'); |
|
| 28 | + $table->string('class', 512); |
|
| 29 | + $table->smallInteger('column'); |
|
| 30 | + $table->smallInteger('row'); |
|
| 31 | + $table->text('options'); |
|
| 32 | 32 | |
| 33 | - $table->foreign('dashboard_id')->references('id')->on('dashboards'); |
|
| 34 | - }); |
|
| 35 | - } |
|
| 33 | + $table->foreign('dashboard_id')->references('id')->on('dashboards'); |
|
| 34 | + }); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Reverse the migrations. |
|
| 39 | - * |
|
| 40 | - * @return void |
|
| 41 | - */ |
|
| 42 | - public function down() |
|
| 43 | - { |
|
| 44 | - Schema::dropIfExists('dashboard_applets'); |
|
| 45 | - Schema::dropIfExists('dashboards'); |
|
| 46 | - } |
|
| 37 | + /** |
|
| 38 | + * Reverse the migrations. |
|
| 39 | + * |
|
| 40 | + * @return void |
|
| 41 | + */ |
|
| 42 | + public function down() |
|
| 43 | + { |
|
| 44 | + Schema::dropIfExists('dashboard_applets'); |
|
| 45 | + Schema::dropIfExists('dashboards'); |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $this->down(); |
| 17 | 17 | |
| 18 | - Schema::create('dashboards', function (Blueprint $table) { |
|
| 18 | + Schema::create('dashboards', function(Blueprint $table) { |
|
| 19 | 19 | $table->increments('id'); |
| 20 | 20 | $table->unsignedInteger('user_id'); |
| 21 | 21 | $table->string('name', 64); |
| 22 | 22 | $table->smallInteger('position'); |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | - Schema::create('dashboard_applets', function (Blueprint $table) { |
|
| 25 | + Schema::create('dashboard_applets', function(Blueprint $table) { |
|
| 26 | 26 | $table->increments('id'); |
| 27 | 27 | $table->unsignedInteger('dashboard_id'); |
| 28 | 28 | $table->string('class', 512); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $this->set($joint->info())->setAttr('searchkey', strtolower($joint->caption() . ';' . $joint->info())); |
| 29 | 29 | } |
| 30 | 30 | else { |
| 31 | - if (! $this->locked) { |
|
| 31 | + if (!$this->locked) { |
|
| 32 | 32 | $this->addControl('close', 'applet-close')->setAttr('title', __('Close applet')); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | if ($this->admin) { |
| 28 | 28 | $this->set($joint->info())->setAttr('searchkey', strtolower($joint->caption() . ';' . $joint->info())); |
| 29 | - } |
|
| 30 | - else { |
|
| 29 | + } else { |
|
| 31 | 30 | if (! $this->locked) { |
| 32 | 31 | $this->addControl('close', 'applet-close')->setAttr('title', __('Close applet')); |
| 33 | 32 | } |