Completed
Push — master ( 5050df...77fab1 )
by Sherif
01:58
created
src/Modules/Core/Database/Seeds/ClearDataSeeder.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 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', ['setting']);
17
-        \DB::table('roles_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', ['setting']);
17
+		\DB::table('roles_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
+		$permissions->delete();
19
+	}
20 20
 }
Please login to merge, or discard this patch.
src/Modules/Core/Database/Seeds/AssignRelationsSeeder.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 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
-        $adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id;
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id;
17 17
 
18
-        /**
19
-         * Assign the permissions to the admin role.
20
-         */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['setting'])->each(function ($permission) use ($adminRoleId) {
22
-            \DB::table('roles_permissions')->insert(
23
-                [
24
-                'permission_id' => $permission->id,
25
-                'role_id'      => $adminRoleId,
26
-                'created_at'    => \DB::raw('NOW()'),
27
-                'updated_at'    => \DB::raw('NOW()')
28
-                ]
29
-            );
30
-        });
31
-    }
18
+		/**
19
+		 * Assign the permissions to the admin role.
20
+		 */
21
+		\DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['setting'])->each(function ($permission) use ($adminRoleId) {
22
+			\DB::table('roles_permissions')->insert(
23
+				[
24
+				'permission_id' => $permission->id,
25
+				'role_id'      => $adminRoleId,
26
+				'created_at'    => \DB::raw('NOW()'),
27
+				'updated_at'    => \DB::raw('NOW()')
28
+				]
29
+			);
30
+		});
31
+	}
32 32
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin role.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['setting'])->each(function ($permission) use ($adminRoleId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['setting'])->each(function($permission) use ($adminRoleId) {
22 22
             \DB::table('roles_permissions')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/Core/Http/Controllers/ApiDocumentController.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -5,81 +5,81 @@
 block discarded – undo
5 5
 
6 6
 class ApiDocumentController extends Controller
7 7
 {
8
-    public function index()
9
-    {
10
-        $jsonDoc    = json_decode(file_get_contents(app_path('Modules/Core/Resources/api.json')), true);
11
-        $modules    = $jsonDoc['modules'];
12
-        $reports    = $jsonDoc['reports'];
13
-        $errors     = $jsonDoc['errors'];
14
-        $models     = $jsonDoc['models'];
15
-        $conditions = [
16
-            [
17
-                'title'   => 'email equal [email protected]:',
18
-                'content' => ['email' => '[email protected]']
19
-            ],
20
-            [
21
-                'title'   => 'email equal [email protected] and user is blocked:',
22
-                'content' => ['and' => ['email' => '[email protected]', 'blocked' => 1]]
23
-            ],
24
-            [
25
-                'title'   => 'email equal [email protected] or user is blocked:',
26
-                'content' => ['or' => ['email' => '[email protected]', 'blocked' => 1]]
27
-            ],
28
-            [
29
-                'title'   => 'email contain John:',
30
-                'content' => ['email' => ['op' => 'like', 'val' => '%John%']]
31
-            ],
32
-            [
33
-                'title'   => 'user created after 2016-10-25:',
34
-                'content' => ['created_at' => ['op' => '>', 'val' => '2016-10-25']]
35
-            ],
36
-            [
37
-                'title'   => 'user created between 2016-10-20 and 2016-10-25:',
38
-                'content' => ['created_at' => ['op' => 'between', 'val1' => '2016-10-20', 'val2' => '2016-10-25']]
39
-            ],
40
-            [
41
-                'title'   => 'user id in 1,2,3:',
42
-                'content' => ['id' => ['op' => 'in', 'val' => [1, 2, 3]]]
43
-            ],
44
-            [
45
-                'title'   => 'user name is null:',
46
-                'content' => ['name' => ['op' => 'null']]
47
-            ],
48
-            [
49
-                'title'   => 'user name is not null:',
50
-                'content' => ['name' => ['op' => 'not null']]
51
-            ],
52
-            [
53
-                'title'   => 'user has role admin:',
54
-                'content' => ['roles' => ['op' => 'has', 'val' => ['name' => 'Admin']]]
55
-            ]
56
-        ];
8
+	public function index()
9
+	{
10
+		$jsonDoc    = json_decode(file_get_contents(app_path('Modules/Core/Resources/api.json')), true);
11
+		$modules    = $jsonDoc['modules'];
12
+		$reports    = $jsonDoc['reports'];
13
+		$errors     = $jsonDoc['errors'];
14
+		$models     = $jsonDoc['models'];
15
+		$conditions = [
16
+			[
17
+				'title'   => 'email equal [email protected]:',
18
+				'content' => ['email' => '[email protected]']
19
+			],
20
+			[
21
+				'title'   => 'email equal [email protected] and user is blocked:',
22
+				'content' => ['and' => ['email' => '[email protected]', 'blocked' => 1]]
23
+			],
24
+			[
25
+				'title'   => 'email equal [email protected] or user is blocked:',
26
+				'content' => ['or' => ['email' => '[email protected]', 'blocked' => 1]]
27
+			],
28
+			[
29
+				'title'   => 'email contain John:',
30
+				'content' => ['email' => ['op' => 'like', 'val' => '%John%']]
31
+			],
32
+			[
33
+				'title'   => 'user created after 2016-10-25:',
34
+				'content' => ['created_at' => ['op' => '>', 'val' => '2016-10-25']]
35
+			],
36
+			[
37
+				'title'   => 'user created between 2016-10-20 and 2016-10-25:',
38
+				'content' => ['created_at' => ['op' => 'between', 'val1' => '2016-10-20', 'val2' => '2016-10-25']]
39
+			],
40
+			[
41
+				'title'   => 'user id in 1,2,3:',
42
+				'content' => ['id' => ['op' => 'in', 'val' => [1, 2, 3]]]
43
+			],
44
+			[
45
+				'title'   => 'user name is null:',
46
+				'content' => ['name' => ['op' => 'null']]
47
+			],
48
+			[
49
+				'title'   => 'user name is not null:',
50
+				'content' => ['name' => ['op' => 'not null']]
51
+			],
52
+			[
53
+				'title'   => 'user has role admin:',
54
+				'content' => ['roles' => ['op' => 'has', 'val' => ['name' => 'Admin']]]
55
+			]
56
+		];
57 57
 
58
-        $paginateObject = [
59
-            'data' => ['Array of model objects'],
60
-            "links" => [
61
-                "first" => "apiUrl?page=1",
62
-                "last" => "apiUrl?page=3",
63
-                "prev" => "apiUrl?page=2",
64
-                "next" => "apiUrl?page=3"
65
-            ],
66
-            "meta" => [
67
-                "current_page" => 2,
68
-                "from" => 6,
69
-                "last_page" => 3,
70
-                "path" => "apiUrl",
71
-                "per_page" => 5,
72
-                "to" => 10,
73
-                "total" => 15
74
-            ]
75
-        ];
58
+		$paginateObject = [
59
+			'data' => ['Array of model objects'],
60
+			"links" => [
61
+				"first" => "apiUrl?page=1",
62
+				"last" => "apiUrl?page=3",
63
+				"prev" => "apiUrl?page=2",
64
+				"next" => "apiUrl?page=3"
65
+			],
66
+			"meta" => [
67
+				"current_page" => 2,
68
+				"from" => 6,
69
+				"last_page" => 3,
70
+				"path" => "apiUrl",
71
+				"per_page" => 5,
72
+				"to" => 10,
73
+				"total" => 15
74
+			]
75
+		];
76 76
         
77
-        $responseObject = [
78
-            'data' => ['The model object']
79
-        ];
77
+		$responseObject = [
78
+			'data' => ['The model object']
79
+		];
80 80
 
81
-        $avaialableReports = \Core::reports()->all();
81
+		$avaialableReports = \Core::reports()->all();
82 82
 
83
-        return view('core::doc', ['modules' => $modules, 'reports' => $reports, 'errors' => $errors, 'conditions' => $conditions, 'models' => $models, 'paginateObject' => json_encode($paginateObject, JSON_PRETTY_PRINT), 'responseObject' => json_encode($responseObject, JSON_PRETTY_PRINT), 'avaialableReports' => $avaialableReports]);
84
-    }
83
+		return view('core::doc', ['modules' => $modules, 'reports' => $reports, 'errors' => $errors, 'conditions' => $conditions, 'models' => $models, 'paginateObject' => json_encode($paginateObject, JSON_PRETTY_PRINT), 'responseObject' => json_encode($responseObject, JSON_PRETTY_PRINT), 'avaialableReports' => $avaialableReports]);
84
+	}
85 85
 }
Please login to merge, or discard this patch.
Core/Console/Commands/Stubs/Module/Database/Seeds/ClearDataSeeder.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 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', ['DummyModelName']);
17
-        \DB::table('roles_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', ['DummyModelName']);
17
+		\DB::table('roles_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
+		$permissions->delete();
19
+	}
20 20
 }
Please login to merge, or discard this patch.
Core/Console/Commands/Stubs/Module/Database/Seeds/AssignRelationsSeeder.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 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
-        $adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id;
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id;
17 17
 
18
-        /**
19
-         * Assign the permissions to the admin role.
20
-         */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['DummyModelName'])->each(function ($permission) use ($adminRoleId) {
22
-            \DB::table('roles_permissions')->insert(
23
-                [
24
-                'permission_id' => $permission->id,
25
-                'role_id'      => $adminRoleId,
26
-                'created_at'    => \DB::raw('NOW()'),
27
-                'updated_at'    => \DB::raw('NOW()')
28
-                ]
29
-            );
30
-        });
31
-    }
18
+		/**
19
+		 * Assign the permissions to the admin role.
20
+		 */
21
+		\DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['DummyModelName'])->each(function ($permission) use ($adminRoleId) {
22
+			\DB::table('roles_permissions')->insert(
23
+				[
24
+				'permission_id' => $permission->id,
25
+				'role_id'      => $adminRoleId,
26
+				'created_at'    => \DB::raw('NOW()'),
27
+				'updated_at'    => \DB::raw('NOW()')
28
+				]
29
+			);
30
+		});
31
+	}
32 32
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin role.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['DummyModelName'])->each(function ($permission) use ($adminRoleId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['DummyModelName'])->each(function($permission) use ($adminRoleId) {
22 22
             \DB::table('roles_permissions')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/Roles/Database/Seeds/ClearDataSeeder.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 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', ['role']);
17
-        \DB::table('roles_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', ['role']);
17
+		\DB::table('roles_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
18
+		$permissions->delete();
19
+	}
20 20
 }
Please login to merge, or discard this patch.
src/Modules/Roles/Database/Seeds/AssignRelationsSeeder.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 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
-        $adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id;
9
+	/**
10
+	 * Run the database seeds.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function run()
15
+	{
16
+		$adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id;
17 17
 
18
-        /**
19
-         * Assign the permissions to the admin role.
20
-         */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['role'])->each(function ($permission) use ($adminRoleId) {
22
-            \DB::table('roles_permissions')->insert(
23
-                [
24
-                'permission_id' => $permission->id,
25
-                'role_id'      => $adminRoleId,
26
-                'created_at'    => \DB::raw('NOW()'),
27
-                'updated_at'    => \DB::raw('NOW()')
28
-                ]
29
-            );
30
-        });
31
-    }
18
+		/**
19
+		 * Assign the permissions to the admin role.
20
+		 */
21
+		\DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['role'])->each(function ($permission) use ($adminRoleId) {
22
+			\DB::table('roles_permissions')->insert(
23
+				[
24
+				'permission_id' => $permission->id,
25
+				'role_id'      => $adminRoleId,
26
+				'created_at'    => \DB::raw('NOW()'),
27
+				'updated_at'    => \DB::raw('NOW()')
28
+				]
29
+			);
30
+		});
31
+	}
32 32
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin role.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['role'])->each(function ($permission) use ($adminRoleId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['role'])->each(function($permission) use ($adminRoleId) {
22 22
             \DB::table('roles_permissions')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/Roles/Database/Seeds/RolesTableSeeder.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 RolesTableSeeder 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 roles table.
18
-         */
19
-        \DB::table('permissions')->insert(
20
-            [
21
-                /**
22
-                 * Roles model permissions.
23
-                 */
24
-                [
25
-                'name'       => 'index',
26
-                'model'      => 'role',
27
-                'created_at' => \DB::raw('NOW()'),
28
-                'updated_at' => \DB::raw('NOW()')
29
-                ],
30
-                [
31
-                'name'       => 'find',
32
-                'model'      => 'role',
33
-                'created_at' => \DB::raw('NOW()'),
34
-                'updated_at' => \DB::raw('NOW()')
35
-                ],
36
-                [
37
-                'name'       => 'insert',
38
-                'model'      => 'role',
39
-                'created_at' => \DB::raw('NOW()'),
40
-                'updated_at' => \DB::raw('NOW()')
41
-                ],
42
-                [
43
-                'name'       => 'update',
44
-                'model'      => 'role',
45
-                'created_at' => \DB::raw('NOW()'),
46
-                'updated_at' => \DB::raw('NOW()')
47
-                ],
48
-                [
49
-                'name'       => 'delete',
50
-                'model'      => 'role',
51
-                'created_at' => \DB::raw('NOW()'),
52
-                'updated_at' => \DB::raw('NOW()')
53
-                ],
54
-                [
55
-                'name'       => 'deleted',
56
-                'model'      => 'role',
57
-                'created_at' => \DB::raw('NOW()'),
58
-                'updated_at' => \DB::raw('NOW()')
59
-                ],
60
-                [
61
-                'name'       => 'restore',
62
-                'model'      => 'role',
63
-                'created_at' => \DB::raw('NOW()'),
64
-                'updated_at' => \DB::raw('NOW()')
65
-                ],
66
-                [
67
-                'name'       => 'assignPermissions',
68
-                'model'      => 'role',
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 roles table.
18
+		 */
19
+		\DB::table('permissions')->insert(
20
+			[
21
+				/**
22
+				 * Roles model permissions.
23
+				 */
24
+				[
25
+				'name'       => 'index',
26
+				'model'      => 'role',
27
+				'created_at' => \DB::raw('NOW()'),
28
+				'updated_at' => \DB::raw('NOW()')
29
+				],
30
+				[
31
+				'name'       => 'find',
32
+				'model'      => 'role',
33
+				'created_at' => \DB::raw('NOW()'),
34
+				'updated_at' => \DB::raw('NOW()')
35
+				],
36
+				[
37
+				'name'       => 'insert',
38
+				'model'      => 'role',
39
+				'created_at' => \DB::raw('NOW()'),
40
+				'updated_at' => \DB::raw('NOW()')
41
+				],
42
+				[
43
+				'name'       => 'update',
44
+				'model'      => 'role',
45
+				'created_at' => \DB::raw('NOW()'),
46
+				'updated_at' => \DB::raw('NOW()')
47
+				],
48
+				[
49
+				'name'       => 'delete',
50
+				'model'      => 'role',
51
+				'created_at' => \DB::raw('NOW()'),
52
+				'updated_at' => \DB::raw('NOW()')
53
+				],
54
+				[
55
+				'name'       => 'deleted',
56
+				'model'      => 'role',
57
+				'created_at' => \DB::raw('NOW()'),
58
+				'updated_at' => \DB::raw('NOW()')
59
+				],
60
+				[
61
+				'name'       => 'restore',
62
+				'model'      => 'role',
63
+				'created_at' => \DB::raw('NOW()'),
64
+				'updated_at' => \DB::raw('NOW()')
65
+				],
66
+				[
67
+				'name'       => 'assignPermissions',
68
+				'model'      => 'role',
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/Roles/Database/Factories/RoleFactory.php 2 patches
Indentation   +5 added lines, -5 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\Roles\Role::class, function (Faker\Generator $faker) {
4
-    return [
5
-        'name'       => $faker->unique->word(),
6
-        'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
7
-        'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
8
-    ];
4
+	return [
5
+		'name'       => $faker->unique->word(),
6
+		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
7
+		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
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\Roles\Role::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Roles\Role::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.