Completed
Push — master ( 2c4876...f9862b )
by Sherif
10:06
created
src/Modules/V1/Acl/Database/Seeds/PermissionsTableSeeder.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -6,64 +6,64 @@
 block discarded – undo
6 6
 
7 7
 class PermissionsTableSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-    	/**
17
-         * Insert the permissions related to permissions table.
18
-         */
19
-        \DB::table('permissions')->insert(
20
-        	[
21
-        		/**
22
-        		 * Permissions model permissions.
23
-        		 */
24
-        		[
25
-	        	'name'       => 'find',
26
-	        	'model'      => 'permissions',
27
-	        	'created_at' => \DB::raw('NOW()'),
28
-	        	'updated_at' => \DB::raw('NOW()')
29
-	        	],
30
-	        	[
31
-	        	'name'       => 'search',
32
-	        	'model'      => 'permissions',
33
-	        	'created_at' => \DB::raw('NOW()'),
34
-	        	'updated_at' => \DB::raw('NOW()')
35
-	        	],
36
-	        	[
37
-	        	'name'       => 'list',
38
-	        	'model'      => 'permissions',
39
-	        	'created_at' => \DB::raw('NOW()'),
40
-	        	'updated_at' => \DB::raw('NOW()')
41
-	        	],
42
-	        	[
43
-	        	'name'       => 'findby',
44
-	        	'model'      => 'permissions',
45
-	        	'created_at' => \DB::raw('NOW()'),
46
-	        	'updated_at' => \DB::raw('NOW()')
47
-	        	],
48
-	        	[
49
-	        	'name'       => 'first',
50
-	        	'model'      => 'permissions',
51
-	        	'created_at' => \DB::raw('NOW()'),
52
-	        	'updated_at' => \DB::raw('NOW()')
53
-	        	],
54
-	        	[
55
-	        	'name'       => 'paginate',
56
-	        	'model'      => 'permissions',
57
-	        	'created_at' => \DB::raw('NOW()'),
58
-	        	'updated_at' => \DB::raw('NOW()')
59
-	        	],
60
-	        	[
61
-	        	'name'       => 'paginateby',
62
-	        	'model'      => 'permissions',
63
-	        	'created_at' => \DB::raw('NOW()'),
64
-	        	'updated_at' => \DB::raw('NOW()')
65
-	        	]
66
-        	]
67
-        );
68
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		/**
17
+		 * Insert the permissions related to permissions table.
18
+		 */
19
+		\DB::table('permissions')->insert(
20
+			[
21
+				/**
22
+				 * Permissions model permissions.
23
+				 */
24
+				[
25
+				'name'       => 'find',
26
+				'model'      => 'permissions',
27
+				'created_at' => \DB::raw('NOW()'),
28
+				'updated_at' => \DB::raw('NOW()')
29
+				],
30
+				[
31
+				'name'       => 'search',
32
+				'model'      => 'permissions',
33
+				'created_at' => \DB::raw('NOW()'),
34
+				'updated_at' => \DB::raw('NOW()')
35
+				],
36
+				[
37
+				'name'       => 'list',
38
+				'model'      => 'permissions',
39
+				'created_at' => \DB::raw('NOW()'),
40
+				'updated_at' => \DB::raw('NOW()')
41
+				],
42
+				[
43
+				'name'       => 'findby',
44
+				'model'      => 'permissions',
45
+				'created_at' => \DB::raw('NOW()'),
46
+				'updated_at' => \DB::raw('NOW()')
47
+				],
48
+				[
49
+				'name'       => 'first',
50
+				'model'      => 'permissions',
51
+				'created_at' => \DB::raw('NOW()'),
52
+				'updated_at' => \DB::raw('NOW()')
53
+				],
54
+				[
55
+				'name'       => 'paginate',
56
+				'model'      => 'permissions',
57
+				'created_at' => \DB::raw('NOW()'),
58
+				'updated_at' => \DB::raw('NOW()')
59
+				],
60
+				[
61
+				'name'       => 'paginateby',
62
+				'model'      => 'permissions',
63
+				'created_at' => \DB::raw('NOW()'),
64
+				'updated_at' => \DB::raw('NOW()')
65
+				]
66
+			]
67
+		);
68
+	}
69 69
 }
Please login to merge, or discard this patch.
src/Modules/V1/Reporting/Database/Seeds/ReportingDatabaseSeeder.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class ReportingDatabaseSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        $this->call(ClearDataSeeder::class);
17
-    	$this->call(ReportsTableSeeder::class);
18
-        $this->call(AssignRelationsSeeder::class);
19
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$this->call(ClearDataSeeder::class);
17
+		$this->call(ReportsTableSeeder::class);
18
+		$this->call(AssignRelationsSeeder::class);
19
+	}
20 20
 }
Please login to merge, or discard this patch.
src/Modules/V1/Reporting/Database/Seeds/ClearDataSeeder.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class ClearDataSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-        $permissions  = \DB::table('permissions')->whereIn('model', ['reports']);
17
-        \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
-        $permissions->delete();
19
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$permissions  = \DB::table('permissions')->whereIn('model', ['reports']);
17
+		\DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
+		$permissions->delete();
19
+	}
20 20
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function run()
15 15
     {
16
-        $permissions  = \DB::table('permissions')->whereIn('model', ['reports']);
16
+        $permissions = \DB::table('permissions')->whereIn('model', ['reports']);
17 17
         \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18 18
         $permissions->delete();
19 19
     }
Please login to merge, or discard this patch.
src/Modules/V1/Reporting/Database/Seeds/ReportsTableSeeder.php 1 patch
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -6,70 +6,70 @@
 block discarded – undo
6 6
 
7 7
 class ReportsTableSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-    	/**
17
-         * Insert the permissions related to settings table.
18
-         */
19
-        \DB::table('permissions')->insert(
20
-        	[
21
-        		/**
22
-        		 * Reporting model permissions.
23
-        		 */
24
-	        	[
25
-	        	'name'       => 'find',
26
-	        	'model'      => 'reports',
27
-	        	'created_at' => \DB::raw('NOW()'),
28
-	        	'updated_at' => \DB::raw('NOW()')
29
-	        	],
30
-	        	[
31
-	        	'name'       => 'search',
32
-	        	'model'      => 'reports',
33
-	        	'created_at' => \DB::raw('NOW()'),
34
-	        	'updated_at' => \DB::raw('NOW()')
35
-	        	],
36
-	        	[
37
-	        	'name'       => 'list',
38
-	        	'model'      => 'reports',
39
-	        	'created_at' => \DB::raw('NOW()'),
40
-	        	'updated_at' => \DB::raw('NOW()')
41
-	        	],
42
-	        	[
43
-	        	'name'       => 'findby',
44
-	        	'model'      => 'reports',
45
-	        	'created_at' => \DB::raw('NOW()'),
46
-	        	'updated_at' => \DB::raw('NOW()')
47
-	        	],
48
-	        	[
49
-	        	'name'       => 'first',
50
-	        	'model'      => 'reports',
51
-	        	'created_at' => \DB::raw('NOW()'),
52
-	        	'updated_at' => \DB::raw('NOW()')
53
-	        	],
54
-	        	[
55
-	        	'name'       => 'paginate',
56
-	        	'model'      => 'reports',
57
-	        	'created_at' => \DB::raw('NOW()'),
58
-	        	'updated_at' => \DB::raw('NOW()')
59
-	        	],
60
-	        	[
61
-	        	'name'       => 'paginateby',
62
-	        	'model'      => 'reports',
63
-	        	'created_at' => \DB::raw('NOW()'),
64
-	        	'updated_at' => \DB::raw('NOW()')
65
-	        	],
66
-	        	[
67
-	        	'name'       => 'admin_count',
68
-	        	'model'      => 'reports',
69
-	        	'created_at' => \DB::raw('NOW()'),
70
-	        	'updated_at' => \DB::raw('NOW()')
71
-	        	]
72
-        	]
73
-        );
74
-    }
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		/**
17
+		 * Insert the permissions related to settings table.
18
+		 */
19
+		\DB::table('permissions')->insert(
20
+			[
21
+				/**
22
+				 * Reporting model permissions.
23
+				 */
24
+				[
25
+				'name'       => 'find',
26
+				'model'      => 'reports',
27
+				'created_at' => \DB::raw('NOW()'),
28
+				'updated_at' => \DB::raw('NOW()')
29
+				],
30
+				[
31
+				'name'       => 'search',
32
+				'model'      => 'reports',
33
+				'created_at' => \DB::raw('NOW()'),
34
+				'updated_at' => \DB::raw('NOW()')
35
+				],
36
+				[
37
+				'name'       => 'list',
38
+				'model'      => 'reports',
39
+				'created_at' => \DB::raw('NOW()'),
40
+				'updated_at' => \DB::raw('NOW()')
41
+				],
42
+				[
43
+				'name'       => 'findby',
44
+				'model'      => 'reports',
45
+				'created_at' => \DB::raw('NOW()'),
46
+				'updated_at' => \DB::raw('NOW()')
47
+				],
48
+				[
49
+				'name'       => 'first',
50
+				'model'      => 'reports',
51
+				'created_at' => \DB::raw('NOW()'),
52
+				'updated_at' => \DB::raw('NOW()')
53
+				],
54
+				[
55
+				'name'       => 'paginate',
56
+				'model'      => 'reports',
57
+				'created_at' => \DB::raw('NOW()'),
58
+				'updated_at' => \DB::raw('NOW()')
59
+				],
60
+				[
61
+				'name'       => 'paginateby',
62
+				'model'      => 'reports',
63
+				'created_at' => \DB::raw('NOW()'),
64
+				'updated_at' => \DB::raw('NOW()')
65
+				],
66
+				[
67
+				'name'       => 'admin_count',
68
+				'model'      => 'reports',
69
+				'created_at' => \DB::raw('NOW()'),
70
+				'updated_at' => \DB::raw('NOW()')
71
+				]
72
+			]
73
+		);
74
+	}
75 75
 }
Please login to merge, or discard this patch.
src/Modules/V1/Reporting/Database/Seeds/AssignRelationsSeeder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         /**
22 22
          * Assign the permissions to the admin group.
23 23
          */
24
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['reports'])->each(function ($permission) use ($adminGroupId) {
24
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['reports'])->each(function($permission) use ($adminGroupId) {
25 25
         	\DB::table('groups_permissions')->insert(
26 26
 				[
27 27
 				'permission_id' => $permission->id,
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@  discard block
 block discarded – undo
6 6
 
7 7
 class AssignRelationsSeeder extends Seeder
8 8
 {
9
-    /**
10
-     * Run the database seeds.
11
-     *
12
-     * @return void
13
-     */
14
-    public function run()
15
-    {
16
-    	$adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id;
17 17
 
18
-        /**
19
-         * Assign the permissions to the admin group.
20
-         */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['reports'])->each(function ($permission) use ($adminGroupId) {
22
-        	\DB::table('groups_permissions')->insert(
18
+		/**
19
+		 * Assign the permissions to the admin group.
20
+		 */
21
+		\DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['reports'])->each(function ($permission) use ($adminGroupId) {
22
+			\DB::table('groups_permissions')->insert(
23 23
 				[
24 24
 				'permission_id' => $permission->id,
25 25
 				'group_id'      => $adminGroupId,
@@ -27,6 +27,6 @@  discard block
 block discarded – undo
27 27
 				'updated_at'    => \DB::raw('NOW()')
28 28
 				]
29 29
 			);
30
-        });
31
-    }
30
+		});
31
+	}
32 32
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Factories/GroupFactory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\V1\Acl\AclGroup::class, function (Faker\Generator $faker) {
4
-    return [
4
+	return [
5 5
 		'name'       => $faker->unique->word(),
6 6
 		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
7 7
 		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
8
-    ];
8
+	];
9 9
 });
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\V1\Acl\AclGroup::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\V1\Acl\AclGroup::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
 		'name'       => $faker->unique->word(),
6 6
 		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/Factories/PermissionFactory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\V1\Acl\AclPermission::class, function (Faker\Generator $faker) {
4
-    return [
4
+	return [
5 5
 		'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6 6
 		'model'      => $faker->randomElement(['users', 'groups', 'settings', 'notifications']),
7 7
 		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
8 8
 		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
9
-    ];
9
+	];
10 10
 });
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\V1\Acl\AclPermission::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\V1\Acl\AclPermission::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
 		'name'       => $faker->randomElement(['save', 'delete', 'find', 'paginate']),
6 6
 		'model'      => $faker->randomElement(['users', 'groups', 'settings', 'notifications']),
Please login to merge, or discard this patch.
src/Modules/V1/Acl/ModelObservers/AclPermissionObserver.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -5,53 +5,53 @@
 block discarded – undo
5 5
  */
6 6
 class AclPermissionObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
12
-
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
17
-
18
-    public function creating($model)
19
-    {
20
-        //
21
-    }
22
-
23
-    public function created($model)
24
-    {
25
-        //
26
-    }
27
-
28
-    public function updating($model)
29
-    {
30
-        //
31
-    }
32
-
33
-    public function updated($model)
34
-    {
35
-        //
36
-    }
37
-
38
-    public function deleting($model)
39
-    {
40
-        //
41
-    }
42
-
43
-    public function deleted($model)
44
-    {
45
-        //
46
-    }
47
-
48
-    public function restoring($model)
49
-    {
50
-        //
51
-    }
52
-
53
-    public function restored($model)
54
-    {
55
-        //
56
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12
+
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17
+
18
+	public function creating($model)
19
+	{
20
+		//
21
+	}
22
+
23
+	public function created($model)
24
+	{
25
+		//
26
+	}
27
+
28
+	public function updating($model)
29
+	{
30
+		//
31
+	}
32
+
33
+	public function updated($model)
34
+	{
35
+		//
36
+	}
37
+
38
+	public function deleting($model)
39
+	{
40
+		//
41
+	}
42
+
43
+	public function deleted($model)
44
+	{
45
+		//
46
+	}
47
+
48
+	public function restoring($model)
49
+	{
50
+		//
51
+	}
52
+
53
+	public function restored($model)
54
+	{
55
+		//
56
+	}
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/V1/Acl/ModelObservers/AclGroupObserver.php 1 patch
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -5,71 +5,71 @@
 block discarded – undo
5 5
  */
6 6
 class AclGroupObserver {
7 7
 
8
-    public function saving($model)
9
-    {
10
-        //
11
-    }
8
+	public function saving($model)
9
+	{
10
+		//
11
+	}
12 12
 
13
-    public function saved($model)
14
-    {
15
-        //
16
-    }
13
+	public function saved($model)
14
+	{
15
+		//
16
+	}
17 17
 
18
-    public function creating($model)
19
-    {
20
-        //
21
-    }
18
+	public function creating($model)
19
+	{
20
+		//
21
+	}
22 22
 
23
-    public function created($model)
24
-    {
25
-        //
26
-    }
23
+	public function created($model)
24
+	{
25
+		//
26
+	}
27 27
 
28
-    /**
29
-     * Prevent updating of the admin group.
30
-     * 
31
-     * @param  object $model the model beign updated.
32
-     * @return void
33
-     */
34
-    public function updating($model)
35
-    {
36
-        if ($model->getOriginal('name') == 'Admin') 
37
-        {
38
-            \ErrorHandler::noPermissions();
39
-        }
40
-    }
28
+	/**
29
+	 * Prevent updating of the admin group.
30
+	 * 
31
+	 * @param  object $model the model beign updated.
32
+	 * @return void
33
+	 */
34
+	public function updating($model)
35
+	{
36
+		if ($model->getOriginal('name') == 'Admin') 
37
+		{
38
+			\ErrorHandler::noPermissions();
39
+		}
40
+	}
41 41
 
42
-    public function updated($model)
43
-    {
44
-        //
45
-    }
42
+	public function updated($model)
43
+	{
44
+		//
45
+	}
46 46
 
47
-    /**
48
-     * Prevent deleting the admin group.
49
-     * 
50
-     * @param  object $model the delted model.
51
-     * @return void
52
-     */
53
-    public function deleting($model)
54
-    {
55
-        if ($model->getOriginal('name') == 'Admin') 
56
-        {
57
-            \ErrorHandler::noPermissions();
58
-        }
59
-    }
47
+	/**
48
+	 * Prevent deleting the admin group.
49
+	 * 
50
+	 * @param  object $model the delted model.
51
+	 * @return void
52
+	 */
53
+	public function deleting($model)
54
+	{
55
+		if ($model->getOriginal('name') == 'Admin') 
56
+		{
57
+			\ErrorHandler::noPermissions();
58
+		}
59
+	}
60 60
 
61
-    public function deleted($model)
62
-    {
63
-        //
64
-    }
61
+	public function deleted($model)
62
+	{
63
+		//
64
+	}
65 65
 
66
-    public function restoring($model)
67
-    {
68
-        //
69
-    }
66
+	public function restoring($model)
67
+	{
68
+		//
69
+	}
70 70
 
71
-    public function restored($model)
72
-    {
73
-        //
74
-    }
71
+	public function restored($model)
72
+	{
73
+		//
74
+	}
75 75
 }
76 76
\ No newline at end of file
Please login to merge, or discard this patch.