Completed
Branch master (d19b6f)
by Jonathan
08:09
created
app/Http/Controllers/User/EditController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@
 block discarded – undo
21 21
         $record = $this->getRecordFromRequest();
22 22
 
23 23
         // Get roles already linked to the role
24
-        $selectedRoleIds = [];
24
+        $selectedRoleIds = [ ];
25 25
 
26 26
         if ($record) {
27 27
             foreach ($record->rolesOnDomain($domain) as $role) {
28
-                $selectedRoleIds[] = $role->id;
28
+                $selectedRoleIds[ ] = $role->id;
29 29
             }
30 30
         }
31 31
 
32 32
         // Get all domain roles
33
-        $roles = [];
33
+        $roles = [ ];
34 34
         foreach ($domain->roles as $role) {
35
-            $roles[$role->id] = $role->name;
35
+            $roles[ $role->id ] = $role->name;
36 36
         }
37 37
 
38 38
         // Add data to the view
Please login to merge, or discard this patch.
app/Http/Controllers/Role/EditController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,21 +21,21 @@
 block discarded – undo
21 21
         $record = $this->getRecordFromRequest();
22 22
 
23 23
         // Get profiles already linked to the role
24
-        $selectedProfileIds = [];
24
+        $selectedProfileIds = [ ];
25 25
         if ($record) {
26 26
             foreach ($record->profiles as $profile) {
27 27
                 // Check if the profile is still in the domain
28 28
                 // It is just a security because $profiles (see below) is filtered on the domain
29 29
                 if ($profile->domain->id === $domain->id) {
30
-                    $selectedProfileIds[] = $profile->id;
30
+                    $selectedProfileIds[ ] = $profile->id;
31 31
                 }
32 32
             }
33 33
         }
34 34
 
35 35
         // Get all domain profiles
36
-        $profiles = [];
36
+        $profiles = [ ];
37 37
         foreach ($domain->profiles as $profile) {
38
-            $profiles[$profile->id] = $profile->name;
38
+            $profiles[ $profile->id ] = $profile->name;
39 39
         }
40 40
 
41 41
         // Add data to the view
Please login to merge, or discard this patch.
app/Http/Middleware/CheckPermissions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
         $isModuleActive = $module->isActiveOnDomain($domain);
34 34
 
35 35
         // An user is allowed if he has the capability or if it is an admin module and the user can admin it
36
-        $isUserAllowed =  $user->hasCapabilityOnModule($capability, $domain, $module) || ($module->isAdminModule() && $user->canAdmin($domain, $module));
36
+        $isUserAllowed = $user->hasCapabilityOnModule($capability, $domain, $module) || ($module->isAdminModule() && $user->canAdmin($domain, $module));
37 37
 
38 38
         if (!$isModuleActive) {
39 39
             return abort(404);
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000023_create_relations_table.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create($this->tablePrefix . 'relations', function (Blueprint $table) {
16
+        Schema::create($this->tablePrefix.'relations', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->unsignedInteger('relatedlist_id');
19 19
             $table->unsignedInteger('module_id');
@@ -25,19 +25,19 @@  discard block
 block discarded – undo
25 25
 
26 26
             // Foreign keys
27 27
             $table->foreign('module_id')
28
-                    ->references('id')->on($this->tablePrefix . 'modules')
28
+                    ->references('id')->on($this->tablePrefix.'modules')
29 29
                     ->onDelete('cascade');
30 30
 
31 31
             $table->foreign('related_module_id')
32
-                    ->references('id')->on($this->tablePrefix . 'modules')
32
+                    ->references('id')->on($this->tablePrefix.'modules')
33 33
                     ->onDelete('cascade');
34 34
 
35 35
             $table->foreign('relatedlist_id')
36
-                    ->references('id')->on($this->tablePrefix . 'relatedlists')
36
+                    ->references('id')->on($this->tablePrefix.'relatedlists')
37 37
                     ->onDelete('cascade');
38 38
 
39 39
             // Unique keys
40
-            $table->unique(['module_id', 'record_id', 'related_record_id', 'related_module_id', 'relatedlist_id'], 'relations_unique_key');
40
+            $table->unique([ 'module_id', 'record_id', 'related_record_id', 'related_module_id', 'relatedlist_id' ], 'relations_unique_key');
41 41
         });
42 42
     }
43 43
 
@@ -48,6 +48,6 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function down()
50 50
     {
51
-        Schema::dropIfExists($this->tablePrefix . 'relations');
51
+        Schema::dropIfExists($this->tablePrefix.'relations');
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000008_create_capabilities_table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      */
15 15
     public function up()
16 16
     {
17
-        Schema::create($this->tablePrefix . 'capabilities', function (Blueprint $table) {
17
+        Schema::create($this->tablePrefix.'capabilities', function(Blueprint $table) {
18 18
             $table->increments('id');
19 19
             $table->string('name');
20 20
             $table->timestamps();
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function down()
32 32
     {
33
-        Schema::dropIfExists($this->tablePrefix . 'capabilities');
33
+        Schema::dropIfExists($this->tablePrefix.'capabilities');
34 34
     }
35 35
 
36 36
     protected function addCapabilities()
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000000_alter_users_table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::table('users', function (Blueprint $table) {
16
+        Schema::table('users', function(Blueprint $table) {
17 17
             $table->string('username')->after('id');
18 18
             $table->string('first_name')->after('username')->nullable();
19 19
             $table->string('phone')->after('password')->nullable();
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function down()
34 34
     {
35
-        Schema::table('users', function (Blueprint $table) {
35
+        Schema::table('users', function(Blueprint $table) {
36 36
             $table->renameColumn('username', 'name');
37 37
             $table->removeColumn('first_name');
38 38
             $table->removeColumn('last_name');
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000007_create_privileges_table.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create($this->tablePrefix . 'privileges', function (Blueprint $table) {
16
+        Schema::create($this->tablePrefix.'privileges', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->unsignedInteger('domain_id');
19 19
             $table->unsignedInteger('role_id');
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 
23 23
             // Foreign keys
24 24
             $table->foreign('domain_id')
25
-                    ->references('id')->on($this->tablePrefix . 'domains')
25
+                    ->references('id')->on($this->tablePrefix.'domains')
26 26
                     ->onDelete('cascade');
27 27
 
28 28
             $table->foreign('role_id')
29
-                    ->references('id')->on($this->tablePrefix . 'roles')
29
+                    ->references('id')->on($this->tablePrefix.'roles')
30 30
                     ->onDelete('cascade');
31 31
 
32 32
             $table->foreign('user_id')
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
                     ->onDelete('cascade');
35 35
 
36 36
             // Unique keys
37
-            $table->unique(['domain_id', 'role_id', 'user_id']);
37
+            $table->unique([ 'domain_id', 'role_id', 'user_id' ]);
38 38
         });
39 39
     }
40 40
 
@@ -45,6 +45,6 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function down()
47 47
     {
48
-        Schema::dropIfExists($this->tablePrefix . 'privileges');
48
+        Schema::dropIfExists($this->tablePrefix.'privileges');
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000012_create_blocks_table.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create($this->tablePrefix . 'blocks', function (Blueprint $table) {
16
+        Schema::create($this->tablePrefix.'blocks', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->unsignedInteger('module_id')->comment('Decrease queries');
19 19
             $table->unsignedInteger('tab_id');
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 
26 26
             // Foreign keys
27 27
             $table->foreign('module_id')
28
-                ->references('id')->on($this->tablePrefix . 'modules')
28
+                ->references('id')->on($this->tablePrefix.'modules')
29 29
                 ->onDelete('cascade');
30 30
 
31 31
             $table->foreign('tab_id')
32
-                    ->references('id')->on($this->tablePrefix . 'tabs')
32
+                    ->references('id')->on($this->tablePrefix.'tabs')
33 33
                     ->onDelete('cascade');
34 34
         });
35 35
     }
@@ -41,6 +41,6 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function down()
43 43
     {
44
-        Schema::dropIfExists($this->tablePrefix . 'blocks');
44
+        Schema::dropIfExists($this->tablePrefix.'blocks');
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
database/migrations/2018_04_15_000014_create_displaytypes_table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      */
15 15
     public function up()
16 16
     {
17
-        Schema::create($this->tablePrefix . 'displaytypes', function (Blueprint $table) {
17
+        Schema::create($this->tablePrefix.'displaytypes', function(Blueprint $table) {
18 18
             $table->increments('id');
19 19
             $table->string('name');
20 20
             $table->string('class');
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function down()
33 33
     {
34
-        Schema::dropIfExists($this->tablePrefix . 'displaytypes');
34
+        Schema::dropIfExists($this->tablePrefix.'displaytypes');
35 35
     }
36 36
 
37 37
     protected function addDisplaytypes()
Please login to merge, or discard this patch.