Completed
Push — master ( eb7f3e...7140fe )
by Sherif
02:49
created
src/Modules/V1/Acl/Database/seeds/DatabaseSeeder.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -4,17 +4,17 @@
 block discarded – undo
4 4
 
5 5
 class DatabaseSeeder extends Seeder
6 6
 {
7
-    /**
8
-     * Run the database seeds.
9
-     *
10
-     * @return void
11
-     */
12
-    public function run()
13
-    {
14
-        $this->call(ClearDataSeeder::class);
15
-    	$this->call(UsersTableSeeder::class);
16
-    	$this->call(GroupsTableSeeder::class);
17
-    	$this->call(PermissionsTableSeeder::class);
18
-    	$this->call(AssignRelationsSeeder::class);
19
-    }
7
+	/**
8
+	 * Run the database seeds.
9
+	 *
10
+	 * @return void
11
+	 */
12
+	public function run()
13
+	{
14
+		$this->call(ClearDataSeeder::class);
15
+		$this->call(UsersTableSeeder::class);
16
+		$this->call(GroupsTableSeeder::class);
17
+		$this->call(PermissionsTableSeeder::class);
18
+		$this->call(AssignRelationsSeeder::class);
19
+	}
20 20
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/seeds/UsersTableSeeder.php 1 patch
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -4,125 +4,125 @@
 block discarded – undo
4 4
 
5 5
 class UsersTableSeeder extends Seeder
6 6
 {
7
-    /**
8
-     * Run the database seeds.
9
-     *
10
-     * @return void
11
-     */
12
-    public function run()
13
-    {
14
-    	/**
15
-         * Insert the permissions related to users table.
16
-         */
17
-        DB::table('permissions')->insert(
18
-        	[
19
-        		/**
20
-        		 * Users model permissions.
21
-        		 */
22
-	        	[
23
-	        	'name'       => 'save',
24
-	        	'model'      => 'users',
25
-	        	'created_at' => \DB::raw('NOW()'),
26
-	        	'updated_at' => \DB::raw('NOW()')
27
-	        	],
28
-	        	[
29
-	        	'name'       => 'delete',
30
-	        	'model'      => 'users',
31
-	        	'created_at' => \DB::raw('NOW()'),
32
-	        	'updated_at' => \DB::raw('NOW()')
33
-	        	],
34
-	        	[
35
-	        	'name'       => 'find',
36
-	        	'model'      => 'users',
37
-	        	'created_at' => \DB::raw('NOW()'),
38
-	        	'updated_at' => \DB::raw('NOW()')
39
-	        	],
40
-	        	[
41
-	        	'name'       => 'list',
42
-	        	'model'      => 'users',
43
-	        	'created_at' => \DB::raw('NOW()'),
44
-	        	'updated_at' => \DB::raw('NOW()')
45
-	        	],
46
-	        	[
47
-	        	'name'       => 'search',
48
-	        	'model'      => 'users',
49
-	        	'created_at' => \DB::raw('NOW()'),
50
-	        	'updated_at' => \DB::raw('NOW()')
51
-	        	],
52
-	        	[
53
-	        	'name'       => 'findby',
54
-	        	'model'      => 'users',
55
-	        	'created_at' => \DB::raw('NOW()'),
56
-	        	'updated_at' => \DB::raw('NOW()')
57
-	        	],
58
-	        	[
59
-	        	'name'       => 'first',
60
-	        	'model'      => 'users',
61
-	        	'created_at' => \DB::raw('NOW()'),
62
-	        	'updated_at' => \DB::raw('NOW()')
63
-	        	],
64
-	        	[
65
-	        	'name'       => 'paginate',
66
-	        	'model'      => 'users',
67
-	        	'created_at' => \DB::raw('NOW()'),
68
-	        	'updated_at' => \DB::raw('NOW()')
69
-	        	],
70
-	        	[
71
-	        	'name'       => 'paginateby',
72
-	        	'model'      => 'users',
73
-	        	'created_at' => \DB::raw('NOW()'),
74
-	        	'updated_at' => \DB::raw('NOW()')
75
-	        	],
76
-	        	[
77
-	        	'name'       => 'assigngroups',
78
-	        	'model'      => 'users',
79
-	        	'created_at' => \DB::raw('NOW()'),
80
-	        	'updated_at' => \DB::raw('NOW()')
81
-	        	],
82
-	        	[
83
-	        	'name'       => 'block',
84
-	        	'model'      => 'users',
85
-	        	'created_at' => \DB::raw('NOW()'),
86
-	        	'updated_at' => \DB::raw('NOW()')
87
-	        	],
88
-	        	[
89
-	        	'name'       => 'unblock',
90
-	        	'model'      => 'users',
91
-	        	'created_at' => \DB::raw('NOW()'),
92
-	        	'updated_at' => \DB::raw('NOW()')
93
-	        	],
94
-	        	[
95
-	        	'name'       => 'group',
96
-	        	'model'      => 'users',
97
-	        	'created_at' => \DB::raw('NOW()'),
98
-	        	'updated_at' => \DB::raw('NOW()')
99
-	        	],
100
-                [
101
-                'name'       => 'deleted',
102
-                'model'      => 'users',
103
-                'created_at' => \DB::raw('NOW()'),
104
-                'updated_at' => \DB::raw('NOW()')
105
-                ],
106
-                [
107
-                'name'       => 'restore',
108
-                'model'      => 'users',
109
-                'created_at' => \DB::raw('NOW()'),
110
-                'updated_at' => \DB::raw('NOW()')
111
-                ]
112
-        	]
113
-        );
7
+	/**
8
+	 * Run the database seeds.
9
+	 *
10
+	 * @return void
11
+	 */
12
+	public function run()
13
+	{
14
+		/**
15
+		 * Insert the permissions related to users table.
16
+		 */
17
+		DB::table('permissions')->insert(
18
+			[
19
+				/**
20
+				 * Users model permissions.
21
+				 */
22
+				[
23
+				'name'       => 'save',
24
+				'model'      => 'users',
25
+				'created_at' => \DB::raw('NOW()'),
26
+				'updated_at' => \DB::raw('NOW()')
27
+				],
28
+				[
29
+				'name'       => 'delete',
30
+				'model'      => 'users',
31
+				'created_at' => \DB::raw('NOW()'),
32
+				'updated_at' => \DB::raw('NOW()')
33
+				],
34
+				[
35
+				'name'       => 'find',
36
+				'model'      => 'users',
37
+				'created_at' => \DB::raw('NOW()'),
38
+				'updated_at' => \DB::raw('NOW()')
39
+				],
40
+				[
41
+				'name'       => 'list',
42
+				'model'      => 'users',
43
+				'created_at' => \DB::raw('NOW()'),
44
+				'updated_at' => \DB::raw('NOW()')
45
+				],
46
+				[
47
+				'name'       => 'search',
48
+				'model'      => 'users',
49
+				'created_at' => \DB::raw('NOW()'),
50
+				'updated_at' => \DB::raw('NOW()')
51
+				],
52
+				[
53
+				'name'       => 'findby',
54
+				'model'      => 'users',
55
+				'created_at' => \DB::raw('NOW()'),
56
+				'updated_at' => \DB::raw('NOW()')
57
+				],
58
+				[
59
+				'name'       => 'first',
60
+				'model'      => 'users',
61
+				'created_at' => \DB::raw('NOW()'),
62
+				'updated_at' => \DB::raw('NOW()')
63
+				],
64
+				[
65
+				'name'       => 'paginate',
66
+				'model'      => 'users',
67
+				'created_at' => \DB::raw('NOW()'),
68
+				'updated_at' => \DB::raw('NOW()')
69
+				],
70
+				[
71
+				'name'       => 'paginateby',
72
+				'model'      => 'users',
73
+				'created_at' => \DB::raw('NOW()'),
74
+				'updated_at' => \DB::raw('NOW()')
75
+				],
76
+				[
77
+				'name'       => 'assigngroups',
78
+				'model'      => 'users',
79
+				'created_at' => \DB::raw('NOW()'),
80
+				'updated_at' => \DB::raw('NOW()')
81
+				],
82
+				[
83
+				'name'       => 'block',
84
+				'model'      => 'users',
85
+				'created_at' => \DB::raw('NOW()'),
86
+				'updated_at' => \DB::raw('NOW()')
87
+				],
88
+				[
89
+				'name'       => 'unblock',
90
+				'model'      => 'users',
91
+				'created_at' => \DB::raw('NOW()'),
92
+				'updated_at' => \DB::raw('NOW()')
93
+				],
94
+				[
95
+				'name'       => 'group',
96
+				'model'      => 'users',
97
+				'created_at' => \DB::raw('NOW()'),
98
+				'updated_at' => \DB::raw('NOW()')
99
+				],
100
+				[
101
+				'name'       => 'deleted',
102
+				'model'      => 'users',
103
+				'created_at' => \DB::raw('NOW()'),
104
+				'updated_at' => \DB::raw('NOW()')
105
+				],
106
+				[
107
+				'name'       => 'restore',
108
+				'model'      => 'users',
109
+				'created_at' => \DB::raw('NOW()'),
110
+				'updated_at' => \DB::raw('NOW()')
111
+				]
112
+			]
113
+		);
114 114
 
115 115
 		/**
116 116
 		 * Create Default users.
117 117
 		 */
118 118
 		DB::table('users')->insertGetId(
119
-            [
119
+			[
120 120
 			'name'       => 'Admin',
121 121
 			'email'      => '[email protected]',
122 122
 			'password'   => bcrypt('123456'),
123 123
 			'created_at' => \DB::raw('NOW()'),
124 124
 			'updated_at' => \DB::raw('NOW()')
125 125
 			]
126
-        );
127
-    }
126
+		);
127
+	}
128 128
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/seeds/AssignRelationsSeeder.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@  discard block
 block discarded – undo
4 4
 
5 5
 class AssignRelationsSeeder extends Seeder
6 6
 {
7
-    /**
8
-     * Run the database seeds.
9
-     *
10
-     * @return void
11
-     */
12
-    public function run()
13
-    {
14
-    	$adminGroupId = DB::table('groups')->whereIn('name', 'admin')->select('id')->first()->id;
7
+	/**
8
+	 * Run the database seeds.
9
+	 *
10
+	 * @return void
11
+	 */
12
+	public function run()
13
+	{
14
+		$adminGroupId = DB::table('groups')->whereIn('name', 'admin')->select('id')->first()->id;
15 15
 		$adminUserId  = DB::table('users')->whereIn('email', '[email protected]')->select('id')->first()->id;
16 16
 
17 17
 		/**
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
 			'created_at' => \DB::raw('NOW()'),
25 25
 			'updated_at' => \DB::raw('NOW()')
26 26
 			]
27
-        );
27
+		);
28 28
 
29
-        /**
29
+		/**
30 30
 		 * Assign the permissions to the admin group.
31 31
 		 */
32
-        DB::table('permissions')->whereIn('model', ['users', 'permissions', 'groups'])->each(function ($permission) use ($adminGroupId) {
33
-        	DB::table('groups_permissions')->insert(
32
+		DB::table('permissions')->whereIn('model', ['users', 'permissions', 'groups'])->each(function ($permission) use ($adminGroupId) {
33
+			DB::table('groups_permissions')->insert(
34 34
 				[
35 35
 				'permission_id' => $permission->id,
36 36
 				'group_id'      => $adminGroupId,
@@ -38,6 +38,6 @@  discard block
 block discarded – undo
38 38
 				'updated_at'    => \DB::raw('NOW()')
39 39
 				]
40 40
 			);
41
-        });
42
-    }
41
+		});
42
+	}
43 43
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     public function run()
13 13
     {
14 14
     	$adminGroupId = DB::table('groups')->whereIn('name', 'admin')->select('id')->first()->id;
15
-		$adminUserId  = DB::table('users')->whereIn('email', '[email protected]')->select('id')->first()->id;
15
+		$adminUserId = DB::table('users')->whereIn('email', '[email protected]')->select('id')->first()->id;
16 16
 
17 17
 		/**
18 18
 		 * Assign users to groups.
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         /**
30 30
 		 * Assign the permissions to the admin group.
31 31
 		 */
32
-        DB::table('permissions')->whereIn('model', ['users', 'permissions', 'groups'])->each(function ($permission) use ($adminGroupId) {
32
+        DB::table('permissions')->whereIn('model', ['users', 'permissions', 'groups'])->each(function($permission) use ($adminGroupId) {
33 33
         	DB::table('groups_permissions')->insert(
34 34
 				[
35 35
 				'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/seeds/PermissionsTableSeeder.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -4,64 +4,64 @@
 block discarded – undo
4 4
 
5 5
 class PermissionsTableSeeder extends Seeder
6 6
 {
7
-    /**
8
-     * Run the database seeds.
9
-     *
10
-     * @return void
11
-     */
12
-    public function run()
13
-    {
14
-    	/**
15
-         * Insert the permissions related to permissions table.
16
-         */
17
-        DB::table('permissions')->insert(
18
-        	[
19
-        		/**
20
-        		 * Permissions model permissions.
21
-        		 */
22
-        		[
23
-	        	'name'       => 'find',
24
-	        	'model'      => 'permissions',
25
-	        	'created_at' => \DB::raw('NOW()'),
26
-	        	'updated_at' => \DB::raw('NOW()')
27
-	        	],
28
-	        	[
29
-	        	'name'       => 'search',
30
-	        	'model'      => 'permissions',
31
-	        	'created_at' => \DB::raw('NOW()'),
32
-	        	'updated_at' => \DB::raw('NOW()')
33
-	        	],
34
-	        	[
35
-	        	'name'       => 'list',
36
-	        	'model'      => 'permissions',
37
-	        	'created_at' => \DB::raw('NOW()'),
38
-	        	'updated_at' => \DB::raw('NOW()')
39
-	        	],
40
-	        	[
41
-	        	'name'       => 'findby',
42
-	        	'model'      => 'permissions',
43
-	        	'created_at' => \DB::raw('NOW()'),
44
-	        	'updated_at' => \DB::raw('NOW()')
45
-	        	],
46
-	        	[
47
-	        	'name'       => 'first',
48
-	        	'model'      => 'permissions',
49
-	        	'created_at' => \DB::raw('NOW()'),
50
-	        	'updated_at' => \DB::raw('NOW()')
51
-	        	],
52
-	        	[
53
-	        	'name'       => 'paginate',
54
-	        	'model'      => 'permissions',
55
-	        	'created_at' => \DB::raw('NOW()'),
56
-	        	'updated_at' => \DB::raw('NOW()')
57
-	        	],
58
-	        	[
59
-	        	'name'       => 'paginateby',
60
-	        	'model'      => 'permissions',
61
-	        	'created_at' => \DB::raw('NOW()'),
62
-	        	'updated_at' => \DB::raw('NOW()')
63
-	        	]
64
-        	]
65
-        );
66
-    }
7
+	/**
8
+	 * Run the database seeds.
9
+	 *
10
+	 * @return void
11
+	 */
12
+	public function run()
13
+	{
14
+		/**
15
+		 * Insert the permissions related to permissions table.
16
+		 */
17
+		DB::table('permissions')->insert(
18
+			[
19
+				/**
20
+				 * Permissions model permissions.
21
+				 */
22
+				[
23
+				'name'       => 'find',
24
+				'model'      => 'permissions',
25
+				'created_at' => \DB::raw('NOW()'),
26
+				'updated_at' => \DB::raw('NOW()')
27
+				],
28
+				[
29
+				'name'       => 'search',
30
+				'model'      => 'permissions',
31
+				'created_at' => \DB::raw('NOW()'),
32
+				'updated_at' => \DB::raw('NOW()')
33
+				],
34
+				[
35
+				'name'       => 'list',
36
+				'model'      => 'permissions',
37
+				'created_at' => \DB::raw('NOW()'),
38
+				'updated_at' => \DB::raw('NOW()')
39
+				],
40
+				[
41
+				'name'       => 'findby',
42
+				'model'      => 'permissions',
43
+				'created_at' => \DB::raw('NOW()'),
44
+				'updated_at' => \DB::raw('NOW()')
45
+				],
46
+				[
47
+				'name'       => 'first',
48
+				'model'      => 'permissions',
49
+				'created_at' => \DB::raw('NOW()'),
50
+				'updated_at' => \DB::raw('NOW()')
51
+				],
52
+				[
53
+				'name'       => 'paginate',
54
+				'model'      => 'permissions',
55
+				'created_at' => \DB::raw('NOW()'),
56
+				'updated_at' => \DB::raw('NOW()')
57
+				],
58
+				[
59
+				'name'       => 'paginateby',
60
+				'model'      => 'permissions',
61
+				'created_at' => \DB::raw('NOW()'),
62
+				'updated_at' => \DB::raw('NOW()')
63
+				]
64
+			]
65
+		);
66
+	}
67 67
 }
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/seeds/GroupsTableSeeder.php 1 patch
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -4,101 +4,101 @@  discard block
 block discarded – undo
4 4
 
5 5
 class GroupsTableSeeder extends Seeder
6 6
 {
7
-    /**
8
-     * Run the database seeds.
9
-     *
10
-     * @return void
11
-     */
12
-    public function run()
13
-    {
14
-    	/**
15
-         * Insert the permissions related to groups table.
16
-         */
17
-        DB::table('permissions')->insert(
18
-        	[
19
-        		/**
20
-        		 * Groups model permissions.
21
-        		 */
22
-	        	[
23
-	        	'name'       => 'save',
24
-	        	'model'      => 'groups',
25
-	        	'created_at' => \DB::raw('NOW()'),
26
-	        	'updated_at' => \DB::raw('NOW()')
27
-	        	],
28
-	        	[
29
-	        	'name'       => 'delete',
30
-	        	'model'      => 'groups',
31
-	        	'created_at' => \DB::raw('NOW()'),
32
-	        	'updated_at' => \DB::raw('NOW()')
33
-	        	],
34
-	        	[
35
-	        	'name'       => 'find',
36
-	        	'model'      => 'groups',
37
-	        	'created_at' => \DB::raw('NOW()'),
38
-	        	'updated_at' => \DB::raw('NOW()')
39
-	        	],
40
-	        	[
41
-	        	'name'       => 'search',
42
-	        	'model'      => 'groups',
43
-	        	'created_at' => \DB::raw('NOW()'),
44
-	        	'updated_at' => \DB::raw('NOW()')
45
-	        	],
46
-	        	[
47
-	        	'name'       => 'list',
48
-	        	'model'      => 'groups',
49
-	        	'created_at' => \DB::raw('NOW()'),
50
-	        	'updated_at' => \DB::raw('NOW()')
51
-	        	],
52
-	        	[
53
-	        	'name'       => 'findby',
54
-	        	'model'      => 'groups',
55
-	        	'created_at' => \DB::raw('NOW()'),
56
-	        	'updated_at' => \DB::raw('NOW()')
57
-	        	],
58
-	        	[
59
-	        	'name'       => 'first',
60
-	        	'model'      => 'groups',
61
-	        	'created_at' => \DB::raw('NOW()'),
62
-	        	'updated_at' => \DB::raw('NOW()')
63
-	        	],
64
-	        	[
65
-	        	'name'       => 'paginate',
66
-	        	'model'      => 'groups',
67
-	        	'created_at' => \DB::raw('NOW()'),
68
-	        	'updated_at' => \DB::raw('NOW()')
69
-	        	],
70
-	        	[
71
-	        	'name'       => 'paginateby',
72
-	        	'model'      => 'groups',
73
-	        	'created_at' => \DB::raw('NOW()'),
74
-	        	'updated_at' => \DB::raw('NOW()')
75
-	        	],
76
-	        	[
77
-	        	'name'       => 'assignpermissions',
78
-	        	'model'      => 'groups',
79
-	        	'created_at' => \DB::raw('NOW()'),
80
-	        	'updated_at' => \DB::raw('NOW()')
81
-	        	],
82
-	        	[
83
-	        	'name'       => 'users',
84
-	        	'model'      => 'groups',
85
-	        	'created_at' => \DB::raw('NOW()'),
86
-	        	'updated_at' => \DB::raw('NOW()')
87
-	        	],
88
-                [
89
-                'name'       => 'deleted',
90
-                'model'      => 'groups',
91
-                'created_at' => \DB::raw('NOW()'),
92
-                'updated_at' => \DB::raw('NOW()')
93
-                ],
94
-                [
95
-                'name'       => 'restore',
96
-                'model'      => 'groups',
97
-                'created_at' => \DB::raw('NOW()'),
98
-                'updated_at' => \DB::raw('NOW()')
99
-                ]
100
-        	]
101
-        );
7
+	/**
8
+	 * Run the database seeds.
9
+	 *
10
+	 * @return void
11
+	 */
12
+	public function run()
13
+	{
14
+		/**
15
+		 * Insert the permissions related to groups table.
16
+		 */
17
+		DB::table('permissions')->insert(
18
+			[
19
+				/**
20
+				 * Groups model permissions.
21
+				 */
22
+				[
23
+				'name'       => 'save',
24
+				'model'      => 'groups',
25
+				'created_at' => \DB::raw('NOW()'),
26
+				'updated_at' => \DB::raw('NOW()')
27
+				],
28
+				[
29
+				'name'       => 'delete',
30
+				'model'      => 'groups',
31
+				'created_at' => \DB::raw('NOW()'),
32
+				'updated_at' => \DB::raw('NOW()')
33
+				],
34
+				[
35
+				'name'       => 'find',
36
+				'model'      => 'groups',
37
+				'created_at' => \DB::raw('NOW()'),
38
+				'updated_at' => \DB::raw('NOW()')
39
+				],
40
+				[
41
+				'name'       => 'search',
42
+				'model'      => 'groups',
43
+				'created_at' => \DB::raw('NOW()'),
44
+				'updated_at' => \DB::raw('NOW()')
45
+				],
46
+				[
47
+				'name'       => 'list',
48
+				'model'      => 'groups',
49
+				'created_at' => \DB::raw('NOW()'),
50
+				'updated_at' => \DB::raw('NOW()')
51
+				],
52
+				[
53
+				'name'       => 'findby',
54
+				'model'      => 'groups',
55
+				'created_at' => \DB::raw('NOW()'),
56
+				'updated_at' => \DB::raw('NOW()')
57
+				],
58
+				[
59
+				'name'       => 'first',
60
+				'model'      => 'groups',
61
+				'created_at' => \DB::raw('NOW()'),
62
+				'updated_at' => \DB::raw('NOW()')
63
+				],
64
+				[
65
+				'name'       => 'paginate',
66
+				'model'      => 'groups',
67
+				'created_at' => \DB::raw('NOW()'),
68
+				'updated_at' => \DB::raw('NOW()')
69
+				],
70
+				[
71
+				'name'       => 'paginateby',
72
+				'model'      => 'groups',
73
+				'created_at' => \DB::raw('NOW()'),
74
+				'updated_at' => \DB::raw('NOW()')
75
+				],
76
+				[
77
+				'name'       => 'assignpermissions',
78
+				'model'      => 'groups',
79
+				'created_at' => \DB::raw('NOW()'),
80
+				'updated_at' => \DB::raw('NOW()')
81
+				],
82
+				[
83
+				'name'       => 'users',
84
+				'model'      => 'groups',
85
+				'created_at' => \DB::raw('NOW()'),
86
+				'updated_at' => \DB::raw('NOW()')
87
+				],
88
+				[
89
+				'name'       => 'deleted',
90
+				'model'      => 'groups',
91
+				'created_at' => \DB::raw('NOW()'),
92
+				'updated_at' => \DB::raw('NOW()')
93
+				],
94
+				[
95
+				'name'       => 'restore',
96
+				'model'      => 'groups',
97
+				'created_at' => \DB::raw('NOW()'),
98
+				'updated_at' => \DB::raw('NOW()')
99
+				]
100
+			]
101
+		);
102 102
 
103 103
 		/**
104 104
 		 * Create Default groups.
@@ -110,5 +110,5 @@  discard block
 block discarded – undo
110 110
 			'updated_at' => \DB::raw('NOW()')
111 111
 			]
112 112
 		);
113
-    }
113
+	}
114 114
 }
Please login to merge, or discard this patch.
src/Modules/V1/Core/Console/Commands/GenerateDoc.php 4 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -156,8 +156,7 @@  discard block
 block discarded – undo
156 156
                 if ($match[1] == '$this->validationRules')
157 157
                 {
158 158
                     $route['body'] = $validationRules;
159
-                }
160
-                else
159
+                } else
161 160
                 {
162 161
                     $route['body'] = eval('return ' . $match[1] . ';');
163 162
                 }
@@ -167,14 +166,12 @@  discard block
 block discarded – undo
167 166
                     if(strpos($rule, 'unique'))
168 167
                     {
169 168
                         $rule = substr($rule, 0, strpos($rule, 'unique') + 6);
170
-                    }
171
-                    elseif(strpos($rule, 'exists'))
169
+                    } elseif(strpos($rule, 'exists'))
172 170
                     {
173 171
                         $rule = substr($rule, 0, strpos($rule, 'exists') - 1);
174 172
                     }
175 173
                 }
176
-            }
177
-            else
174
+            } else
178 175
             {
179 176
                 $route['body'] = 'conditions';
180 177
             }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * Generate headers for the given route.
98 98
      * 
99 99
      * @param  array  &$route
100
-     * @param  object $reflectionClass
100
+     * @param  \ReflectionClass $reflectionClass
101 101
      * @param  string $method
102 102
      * @param  array  $skipLoginCheck
103 103
      * @return void
@@ -124,6 +124,7 @@  discard block
 block discarded – undo
124 124
      * 
125 125
      * @param  array  &$route
126 126
      * @param  object $reflectionMethod]
127
+     * @param \ReflectionMethod $reflectionMethod
127 128
      * @return void
128 129
      */
129 130
     protected function processDocBlock(&$route, $reflectionMethod)
@@ -146,7 +147,7 @@  discard block
 block discarded – undo
146 147
      * Generate post body for the given route.
147 148
      * 
148 149
      * @param  array  &$route
149
-     * @param  object $reflectionMethod
150
+     * @param  \ReflectionMethod $reflectionMethod
150 151
      * @param  array  $validationRules
151 152
      * @return void
152 153
      */
@@ -253,7 +254,6 @@  discard block
 block discarded – undo
253 254
      * Get the route response object type.
254 255
      * 
255 256
      * @param  string $method
256
-     * @param  string $route
257 257
      * @return array
258 258
      */
259 259
     protected function getResponseObject($modelName, $method)
Please login to merge, or discard this patch.
Indentation   +231 added lines, -231 removed lines patch added patch discarded remove patch
@@ -6,261 +6,261 @@
 block discarded – undo
6 6
 
7 7
 class GenerateDoc extends Command
8 8
 {
9
-    /**
10
-     * The name and signature of the console command.
11
-     *
12
-     * @var string
13
-     */
14
-    protected $signature = 'doc:generate';
9
+	/**
10
+	 * The name and signature of the console command.
11
+	 *
12
+	 * @var string
13
+	 */
14
+	protected $signature = 'doc:generate';
15 15
 
16
-    /**
17
-     * The console command description.
18
-     *
19
-     * @var string
20
-     */
21
-    protected $description = 'Generate api documentation';
16
+	/**
17
+	 * The console command description.
18
+	 *
19
+	 * @var string
20
+	 */
21
+	protected $description = 'Generate api documentation';
22 22
 
23
-    /**
24
-     * Create a new command instance.
25
-     *
26
-     * @return void
27
-     */
28
-    public function __construct()
29
-    {
30
-        parent::__construct();
31
-    }
23
+	/**
24
+	 * Create a new command instance.
25
+	 *
26
+	 * @return void
27
+	 */
28
+	public function __construct()
29
+	{
30
+		parent::__construct();
31
+	}
32 32
 
33
-    /**
34
-     * Execute the console command.
35
-     *
36
-     * @return mixed
37
-     */
38
-    public function handle()
39
-    {
40
-        $docData           = [];
41
-        $docData['models'] = [];
42
-        $routes            = $this->getRoutes();
43
-        foreach ($routes as $route) 
44
-        {
45
-            if ($route) 
46
-            {
47
-                $actoinArray       = explode('@', $route['action']);
48
-                $controller        = $actoinArray[0];
49
-                $method            = $actoinArray[1];
50
-                $route['name']     = $method !== 'index' ? $method : 'list';
33
+	/**
34
+	 * Execute the console command.
35
+	 *
36
+	 * @return mixed
37
+	 */
38
+	public function handle()
39
+	{
40
+		$docData           = [];
41
+		$docData['models'] = [];
42
+		$routes            = $this->getRoutes();
43
+		foreach ($routes as $route) 
44
+		{
45
+			if ($route) 
46
+			{
47
+				$actoinArray       = explode('@', $route['action']);
48
+				$controller        = $actoinArray[0];
49
+				$method            = $actoinArray[1];
50
+				$route['name']     = $method !== 'index' ? $method : 'list';
51 51
                 
52
-                $reflectionClass   = new \ReflectionClass($controller);
53
-                $reflectionMethod  = $reflectionClass->getMethod($method);
54
-                $classProperties   = $reflectionClass->getDefaultProperties();
55
-                $skipLoginCheck    = array_key_exists('skipLoginCheck', $classProperties) ? $classProperties['skipLoginCheck'] : false;
56
-                $validationRules   = array_key_exists('validationRules', $classProperties) ? $classProperties['validationRules'] : false;
52
+				$reflectionClass   = new \ReflectionClass($controller);
53
+				$reflectionMethod  = $reflectionClass->getMethod($method);
54
+				$classProperties   = $reflectionClass->getDefaultProperties();
55
+				$skipLoginCheck    = array_key_exists('skipLoginCheck', $classProperties) ? $classProperties['skipLoginCheck'] : false;
56
+				$validationRules   = array_key_exists('validationRules', $classProperties) ? $classProperties['validationRules'] : false;
57 57
                 
58
-                $route['response'] = $this->getResponseObject($classProperties['model'], $route['name']);
58
+				$route['response'] = $this->getResponseObject($classProperties['model'], $route['name']);
59 59
 
60
-                $this->processDocBlock($route, $reflectionMethod);
61
-                $this->getHeaders($route, $reflectionClass, $method, $skipLoginCheck);
62
-                $this->getPostData($route, $reflectionMethod, $validationRules);
60
+				$this->processDocBlock($route, $reflectionMethod);
61
+				$this->getHeaders($route, $reflectionClass, $method, $skipLoginCheck);
62
+				$this->getPostData($route, $reflectionMethod, $validationRules);
63 63
 
64
-                preg_match('/api\/v1\/([^#]+)\//iU', $route['uri'], $module);
65
-                preg_match('/api\/v1\/' . $module[1] . '\/([^#]+)\//iU', $route['uri'], $model);
66
-                $docData['modules'][$module[1]][$model[1]][] = $route;
64
+				preg_match('/api\/v1\/([^#]+)\//iU', $route['uri'], $module);
65
+				preg_match('/api\/v1\/' . $module[1] . '\/([^#]+)\//iU', $route['uri'], $model);
66
+				$docData['modules'][$module[1]][$model[1]][] = $route;
67 67
 
68
-                $this->getModels($classProperties['model'], $docData);
69
-            }
70
-        }
68
+				$this->getModels($classProperties['model'], $docData);
69
+			}
70
+		}
71 71
         
72
-        $docData['errors'] = $this->getErrors();
73
-        \File::put(app_path('Modules/V1/Core/Resources/api.json'), json_encode($docData));
74
-    }
72
+		$docData['errors'] = $this->getErrors();
73
+		\File::put(app_path('Modules/V1/Core/Resources/api.json'), json_encode($docData));
74
+	}
75 75
 
76
-    /**
77
-     * Get list of all registered routes.
78
-     * 
79
-     * @return collection
80
-     */
81
-    protected function getRoutes()
82
-    {
83
-        return collect(\Route::getRoutes())->map(function ($route) {
84
-            if (strpos($route->uri(), 'api/v') !== false) 
85
-            {
86
-                return [
87
-                    'method' => $route->methods()[0],
88
-                    'uri'    => $route->uri(),
89
-                    'action' => $route->getActionName()
90
-                ];
91
-            }
92
-            return false;
93
-        })->all();
94
-    }
76
+	/**
77
+	 * Get list of all registered routes.
78
+	 * 
79
+	 * @return collection
80
+	 */
81
+	protected function getRoutes()
82
+	{
83
+		return collect(\Route::getRoutes())->map(function ($route) {
84
+			if (strpos($route->uri(), 'api/v') !== false) 
85
+			{
86
+				return [
87
+					'method' => $route->methods()[0],
88
+					'uri'    => $route->uri(),
89
+					'action' => $route->getActionName()
90
+				];
91
+			}
92
+			return false;
93
+		})->all();
94
+	}
95 95
 
96
-    /**
97
-     * Generate headers for the given route.
98
-     * 
99
-     * @param  array  &$route
100
-     * @param  object $reflectionClass
101
-     * @param  string $method
102
-     * @param  array  $skipLoginCheck
103
-     * @return void
104
-     */
105
-    protected function getHeaders(&$route, $reflectionClass, $method, $skipLoginCheck)
106
-    {
107
-        $route['headers'] = [
108
-        'Accept'         => 'application/json',
109
-        'Content-Type'   => 'application/json',
110
-        'locale'         => 'The language of the returned data: ar, en or all.',
111
-        'time-zone-diff' => 'Timezone difference between UTC and Local Time',
112
-        ];
96
+	/**
97
+	 * Generate headers for the given route.
98
+	 * 
99
+	 * @param  array  &$route
100
+	 * @param  object $reflectionClass
101
+	 * @param  string $method
102
+	 * @param  array  $skipLoginCheck
103
+	 * @return void
104
+	 */
105
+	protected function getHeaders(&$route, $reflectionClass, $method, $skipLoginCheck)
106
+	{
107
+		$route['headers'] = [
108
+		'Accept'         => 'application/json',
109
+		'Content-Type'   => 'application/json',
110
+		'locale'         => 'The language of the returned data: ar, en or all.',
111
+		'time-zone-diff' => 'Timezone difference between UTC and Local Time',
112
+		];
113 113
 
114 114
 
115
-        if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) 
116
-        {
117
-            $route['headers']['Authrization'] = 'bearer {token}';
118
-        }
119
-    }
115
+		if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) 
116
+		{
117
+			$route['headers']['Authrization'] = 'bearer {token}';
118
+		}
119
+	}
120 120
 
121
-    /**
122
-     * Generate description and params for the given route
123
-     * based on the docblock.
124
-     * 
125
-     * @param  array  &$route
126
-     * @param  object $reflectionMethod]
127
-     * @return void
128
-     */
129
-    protected function processDocBlock(&$route, $reflectionMethod)
130
-    {
131
-        $factory              = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
132
-        $docblock             = $factory->create($reflectionMethod->getDocComment());
133
-        $route['description'] = trim(preg_replace('/\s+/', ' ', $docblock->getSummary()));
134
-        $params               = $docblock->getTagsByName('param');
135
-        foreach ($params as $param) 
136
-        {
137
-            $name = $param->getVariableName();
138
-            if ($name !== 'request') 
139
-            {
140
-                $route['parametars'][$param->getVariableName()] = $param->getDescription()->render();
141
-            }
142
-        }
143
-    }
121
+	/**
122
+	 * Generate description and params for the given route
123
+	 * based on the docblock.
124
+	 * 
125
+	 * @param  array  &$route
126
+	 * @param  object $reflectionMethod]
127
+	 * @return void
128
+	 */
129
+	protected function processDocBlock(&$route, $reflectionMethod)
130
+	{
131
+		$factory              = \phpDocumentor\Reflection\DocBlockFactory::createInstance();
132
+		$docblock             = $factory->create($reflectionMethod->getDocComment());
133
+		$route['description'] = trim(preg_replace('/\s+/', ' ', $docblock->getSummary()));
134
+		$params               = $docblock->getTagsByName('param');
135
+		foreach ($params as $param) 
136
+		{
137
+			$name = $param->getVariableName();
138
+			if ($name !== 'request') 
139
+			{
140
+				$route['parametars'][$param->getVariableName()] = $param->getDescription()->render();
141
+			}
142
+		}
143
+	}
144 144
 
145
-    /**
146
-     * Generate post body for the given route.
147
-     * 
148
-     * @param  array  &$route
149
-     * @param  object $reflectionMethod
150
-     * @param  array  $validationRules
151
-     * @return void
152
-     */
153
-    protected function getPostData(&$route, $reflectionMethod, $validationRules)
154
-    {
155
-        if ($route['method'] == 'POST') 
156
-        {
157
-            $body = $this->getMethodBody($reflectionMethod);
145
+	/**
146
+	 * Generate post body for the given route.
147
+	 * 
148
+	 * @param  array  &$route
149
+	 * @param  object $reflectionMethod
150
+	 * @param  array  $validationRules
151
+	 * @return void
152
+	 */
153
+	protected function getPostData(&$route, $reflectionMethod, $validationRules)
154
+	{
155
+		if ($route['method'] == 'POST') 
156
+		{
157
+			$body = $this->getMethodBody($reflectionMethod);
158 158
 
159
-            preg_match('/\$this->validate\(\$request,([^#]+)\);/iU', $body, $match);
160
-            if (count($match)) 
161
-            {
162
-                if ($match[1] == '$this->validationRules')
163
-                {
164
-                    $route['body'] = $validationRules;
165
-                }
166
-                else
167
-                {
168
-                    $route['body'] = eval('return ' . $match[1] . ';');
169
-                }
159
+			preg_match('/\$this->validate\(\$request,([^#]+)\);/iU', $body, $match);
160
+			if (count($match)) 
161
+			{
162
+				if ($match[1] == '$this->validationRules')
163
+				{
164
+					$route['body'] = $validationRules;
165
+				}
166
+				else
167
+				{
168
+					$route['body'] = eval('return ' . $match[1] . ';');
169
+				}
170 170
 
171
-                foreach ($route['body'] as &$rule) 
172
-                {
173
-                    if(strpos($rule, 'unique'))
174
-                    {
175
-                        $rule = substr($rule, 0, strpos($rule, 'unique') + 6);
176
-                    }
177
-                    elseif(strpos($rule, 'exists'))
178
-                    {
179
-                        $rule = substr($rule, 0, strpos($rule, 'exists') - 1);
180
-                    }
181
-                }
182
-            }
183
-            else
184
-            {
185
-                $route['body'] = 'conditions';
186
-            }
187
-        }
188
-    }
171
+				foreach ($route['body'] as &$rule) 
172
+				{
173
+					if(strpos($rule, 'unique'))
174
+					{
175
+						$rule = substr($rule, 0, strpos($rule, 'unique') + 6);
176
+					}
177
+					elseif(strpos($rule, 'exists'))
178
+					{
179
+						$rule = substr($rule, 0, strpos($rule, 'exists') - 1);
180
+					}
181
+				}
182
+			}
183
+			else
184
+			{
185
+				$route['body'] = 'conditions';
186
+			}
187
+		}
188
+	}
189 189
 
190
-    /**
191
-     * Generate application errors.
192
-     * 
193
-     * @return array
194
-     */
195
-    protected function getErrors()
196
-    {
197
-        $errors          = [];
198
-        $reflectionClass = new \ReflectionClass('App\Modules\V1\Core\Utl\ErrorHandler');
199
-        foreach ($reflectionClass->getMethods() as $method) 
200
-        {
201
-            $methodName       = $method->getName();
202
-            $reflectionMethod = $reflectionClass->getMethod($methodName);
203
-            $body             = $this->getMethodBody($reflectionMethod);
190
+	/**
191
+	 * Generate application errors.
192
+	 * 
193
+	 * @return array
194
+	 */
195
+	protected function getErrors()
196
+	{
197
+		$errors          = [];
198
+		$reflectionClass = new \ReflectionClass('App\Modules\V1\Core\Utl\ErrorHandler');
199
+		foreach ($reflectionClass->getMethods() as $method) 
200
+		{
201
+			$methodName       = $method->getName();
202
+			$reflectionMethod = $reflectionClass->getMethod($methodName);
203
+			$body             = $this->getMethodBody($reflectionMethod);
204 204
 
205
-            preg_match('/\$error=\[\'status\'=>([^#]+)\,/iU', $body, $match);
205
+			preg_match('/\$error=\[\'status\'=>([^#]+)\,/iU', $body, $match);
206 206
 
207
-            if (count($match)) 
208
-            {
209
-                $errors[$match[1]][] = $methodName;
210
-            }
211
-        }
207
+			if (count($match)) 
208
+			{
209
+				$errors[$match[1]][] = $methodName;
210
+			}
211
+		}
212 212
 
213
-        return $errors;
214
-    }
213
+		return $errors;
214
+	}
215 215
 
216
-    /**
217
-     * Get the given method body code.
218
-     * 
219
-     * @param  object $reflectionMethod
220
-     * @return string
221
-     */
222
-    protected function getMethodBody($reflectionMethod)
223
-    {
224
-        $filename   = $reflectionMethod->getFileName();
225
-        $start_line = $reflectionMethod->getStartLine() - 1;
226
-        $end_line   = $reflectionMethod->getEndLine();
227
-        $length     = $end_line - $start_line;         
228
-        $source     = file($filename);
229
-        $body       = implode("", array_slice($source, $start_line, $length));
230
-        $body       = trim(preg_replace('/\s+/', '', $body));
216
+	/**
217
+	 * Get the given method body code.
218
+	 * 
219
+	 * @param  object $reflectionMethod
220
+	 * @return string
221
+	 */
222
+	protected function getMethodBody($reflectionMethod)
223
+	{
224
+		$filename   = $reflectionMethod->getFileName();
225
+		$start_line = $reflectionMethod->getStartLine() - 1;
226
+		$end_line   = $reflectionMethod->getEndLine();
227
+		$length     = $end_line - $start_line;         
228
+		$source     = file($filename);
229
+		$body       = implode("", array_slice($source, $start_line, $length));
230
+		$body       = trim(preg_replace('/\s+/', '', $body));
231 231
 
232
-        return $body;
233
-    }
232
+		return $body;
233
+	}
234 234
 
235
-    /**
236
-     * Get example object of all availble models.
237
-     * 
238
-     * @param  string $modelName
239
-     * @param  object $docData
240
-     * @return string
241
-     */
242
-    protected function getModels($modelName, &$docData)
243
-    {
244
-        if ( ! array_key_exists($modelName, $docData['models'])) 
245
-        {
246
-            $modelClass      = call_user_func_array("\Core::{$modelName}", [])->model;
247
-            $model           = factory($modelClass)->make();
248
-            $docData['models'][$modelName] = json_encode($model->toArray(), JSON_PRETTY_PRINT);
249
-        }
250
-    }
235
+	/**
236
+	 * Get example object of all availble models.
237
+	 * 
238
+	 * @param  string $modelName
239
+	 * @param  object $docData
240
+	 * @return string
241
+	 */
242
+	protected function getModels($modelName, &$docData)
243
+	{
244
+		if ( ! array_key_exists($modelName, $docData['models'])) 
245
+		{
246
+			$modelClass      = call_user_func_array("\Core::{$modelName}", [])->model;
247
+			$model           = factory($modelClass)->make();
248
+			$docData['models'][$modelName] = json_encode($model->toArray(), JSON_PRETTY_PRINT);
249
+		}
250
+	}
251 251
 
252
-    /**
253
-     * Get the route response object type.
254
-     * 
255
-     * @param  string $method
256
-     * @param  string $route
257
-     * @return array
258
-     */
259
-    protected function getResponseObject($modelName, $method)
260
-    {
261
-        $config    = \CoreConfig::getConfig();
262
-        $relations = array_key_exists($modelName, $config['relations']) ? array_key_exists($method, $config['relations'][$modelName]) ? $config['relations'][$modelName] : false : false;
252
+	/**
253
+	 * Get the route response object type.
254
+	 * 
255
+	 * @param  string $method
256
+	 * @param  string $route
257
+	 * @return array
258
+	 */
259
+	protected function getResponseObject($modelName, $method)
260
+	{
261
+		$config    = \CoreConfig::getConfig();
262
+		$relations = array_key_exists($modelName, $config['relations']) ? array_key_exists($method, $config['relations'][$modelName]) ? $config['relations'][$modelName] : false : false;
263 263
 
264
-        return $relations ? [$modelName => $relations && $relations[$method] ? $relations[$method] : []] : false;
265
-    }
264
+		return $relations ? [$modelName => $relations && $relations[$method] ? $relations[$method] : []] : false;
265
+	}
266 266
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                 $this->getPostData($route, $reflectionMethod, $validationRules);
63 63
 
64 64
                 preg_match('/api\/v1\/([^#]+)\//iU', $route['uri'], $module);
65
-                preg_match('/api\/v1\/' . $module[1] . '\/([^#]+)\//iU', $route['uri'], $model);
65
+                preg_match('/api\/v1\/'.$module[1].'\/([^#]+)\//iU', $route['uri'], $model);
66 66
                 $docData['modules'][$module[1]][$model[1]][] = $route;
67 67
 
68 68
                 $this->getModels($classProperties['model'], $docData);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     protected function getRoutes()
82 82
     {
83
-        return collect(\Route::getRoutes())->map(function ($route) {
83
+        return collect(\Route::getRoutes())->map(function($route) {
84 84
             if (strpos($route->uri(), 'api/v') !== false) 
85 85
             {
86 86
                 return [
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         ];
113 113
 
114 114
 
115
-        if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) 
115
+        if ( ! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) 
116 116
         {
117 117
             $route['headers']['Authrization'] = 'bearer {token}';
118 118
         }
@@ -165,16 +165,16 @@  discard block
 block discarded – undo
165 165
                 }
166 166
                 else
167 167
                 {
168
-                    $route['body'] = eval('return ' . $match[1] . ';');
168
+                    $route['body'] = eval('return '.$match[1].';');
169 169
                 }
170 170
 
171 171
                 foreach ($route['body'] as &$rule) 
172 172
                 {
173
-                    if(strpos($rule, 'unique'))
173
+                    if (strpos($rule, 'unique'))
174 174
                     {
175 175
                         $rule = substr($rule, 0, strpos($rule, 'unique') + 6);
176 176
                     }
177
-                    elseif(strpos($rule, 'exists'))
177
+                    elseif (strpos($rule, 'exists'))
178 178
                     {
179 179
                         $rule = substr($rule, 0, strpos($rule, 'exists') - 1);
180 180
                     }
Please login to merge, or discard this patch.
src/Modules/V1/Core/Utl/ErrorHandler.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -2,105 +2,105 @@
 block discarded – undo
2 2
 
3 3
 class ErrorHandler
4 4
 {
5
-    public function unAuthorized()
6
-    {
7
-        $error = ['status' => 401, 'message' => trans('errors.unAuthorized')];
8
-        abort($error['status'], $error['message']);
9
-    }
10
-
11
-    public function tokenExpired()
12
-    {
13
-        $error = ['status' => 403, 'message' => trans('errors.tokenExpired')];
14
-        abort($error['status'], $error['message']);
15
-    }
16
-
17
-     public function noPermissions()
18
-    {
19
-        $error = ['status' => 403, 'message' => trans('errors.noPermissions')];
20
-        abort($error['status'], $error['message']);
21
-    }
22
-
23
-    public function loginFailed()
24
-    {
25
-        $error = ['status' => 400, 'message' => trans('errors.loginFailed')];
26
-        abort($error['status'], $error['message']);
27
-    }
28
-
29
-    public function noSocialEmail()
30
-    {
31
-        $error = ['status' => 400, 'message' => trans('errors.noSocialEmail')];
32
-        abort($error['status'], $error['message']);
33
-    }
34
-
35
-    public function userAlreadyRegistered()
36
-    {
37
-        $error = ['status' => 400, 'message' => trans('errors.userAlreadyRegistered')];
38
-        abort($error['status'], $error['message']);
39
-    }
40
-
41
-    public function connectionError()
42
-    {
43
-        $error = ['status' => 400, 'message' => trans('errors.connectionError')];
44
-        abort($error['status'], $error['message']);
45
-    }
46
-
47
-    public function redisNotRunning()
48
-    {
49
-        $error = ['status' => 400, 'message' => trans('errors.redisNotRunning')];
50
-        abort($error['status'], $error['message']);
51
-    }
52
-
53
-    public function dbQueryError()
54
-    {
55
-        $error = ['status' => 400, 'message' => trans('errors.dbQueryError')];
56
-        abort($error['status'], $error['message']);
57
-    }
58
-
59
-    public function cannotCreateSetting()
60
-    {
61
-        $error = ['status' => 400, 'message' => trans('errors.cannotCreateSetting')];
62
-        abort($error['status'], $error['message']);
63
-    }
64
-
65
-    public function cannotUpdateSettingKey()
66
-    {
67
-        $error = ['status' => 400, 'message' => trans('errors.cannotUpdateSettingKey')];
68
-        abort($error['status'], $error['message']);
69
-    }
70
-
71
-    public function userIsBlocked()
72
-    {
73
-        $error = ['status' => 403, 'message' => trans('errors.userIsBlocked')];
74
-        abort($error['status'], $error['message']);
75
-    }
76
-
77
-    public function invalidResetToken()
78
-    {
79
-        $error = ['status' => 400, 'message' => trans('errors.invalidResetToken')];
80
-        abort($error['status'], $error['message']);
81
-    }
82
-
83
-    public function invalidResetPassword()
84
-    {
85
-        $error = ['status' => 400, 'message' => trans('errors.invalidResetPassword')];
86
-        abort($error['status'], $error['message']);
87
-    }
88
-
89
-    public function invalidOldPassword()
90
-    {
91
-        $error = ['status' => 400, 'message' => trans('errors.invalidOldPassword')];
92
-        abort($error['status'], $error['message']);
93
-    }
94
-
95
-    public function notFound($text)
96
-    {
97
-        $error = ['status' => 404, 'message' => trans('errors.notFound', ['replace' => $text])];
98
-        abort($error['status'], $error['message']);
99
-    }
100
-
101
-    public function generalError()
102
-    {
103
-        $error = ['status' => 400, 'message' => trans('errors.generalError')];
104
-        abort($error['status'], $error['message']);
105
-    }
5
+	public function unAuthorized()
6
+	{
7
+		$error = ['status' => 401, 'message' => trans('errors.unAuthorized')];
8
+		abort($error['status'], $error['message']);
9
+	}
10
+
11
+	public function tokenExpired()
12
+	{
13
+		$error = ['status' => 403, 'message' => trans('errors.tokenExpired')];
14
+		abort($error['status'], $error['message']);
15
+	}
16
+
17
+	 public function noPermissions()
18
+	{
19
+		$error = ['status' => 403, 'message' => trans('errors.noPermissions')];
20
+		abort($error['status'], $error['message']);
21
+	}
22
+
23
+	public function loginFailed()
24
+	{
25
+		$error = ['status' => 400, 'message' => trans('errors.loginFailed')];
26
+		abort($error['status'], $error['message']);
27
+	}
28
+
29
+	public function noSocialEmail()
30
+	{
31
+		$error = ['status' => 400, 'message' => trans('errors.noSocialEmail')];
32
+		abort($error['status'], $error['message']);
33
+	}
34
+
35
+	public function userAlreadyRegistered()
36
+	{
37
+		$error = ['status' => 400, 'message' => trans('errors.userAlreadyRegistered')];
38
+		abort($error['status'], $error['message']);
39
+	}
40
+
41
+	public function connectionError()
42
+	{
43
+		$error = ['status' => 400, 'message' => trans('errors.connectionError')];
44
+		abort($error['status'], $error['message']);
45
+	}
46
+
47
+	public function redisNotRunning()
48
+	{
49
+		$error = ['status' => 400, 'message' => trans('errors.redisNotRunning')];
50
+		abort($error['status'], $error['message']);
51
+	}
52
+
53
+	public function dbQueryError()
54
+	{
55
+		$error = ['status' => 400, 'message' => trans('errors.dbQueryError')];
56
+		abort($error['status'], $error['message']);
57
+	}
58
+
59
+	public function cannotCreateSetting()
60
+	{
61
+		$error = ['status' => 400, 'message' => trans('errors.cannotCreateSetting')];
62
+		abort($error['status'], $error['message']);
63
+	}
64
+
65
+	public function cannotUpdateSettingKey()
66
+	{
67
+		$error = ['status' => 400, 'message' => trans('errors.cannotUpdateSettingKey')];
68
+		abort($error['status'], $error['message']);
69
+	}
70
+
71
+	public function userIsBlocked()
72
+	{
73
+		$error = ['status' => 403, 'message' => trans('errors.userIsBlocked')];
74
+		abort($error['status'], $error['message']);
75
+	}
76
+
77
+	public function invalidResetToken()
78
+	{
79
+		$error = ['status' => 400, 'message' => trans('errors.invalidResetToken')];
80
+		abort($error['status'], $error['message']);
81
+	}
82
+
83
+	public function invalidResetPassword()
84
+	{
85
+		$error = ['status' => 400, 'message' => trans('errors.invalidResetPassword')];
86
+		abort($error['status'], $error['message']);
87
+	}
88
+
89
+	public function invalidOldPassword()
90
+	{
91
+		$error = ['status' => 400, 'message' => trans('errors.invalidOldPassword')];
92
+		abort($error['status'], $error['message']);
93
+	}
94
+
95
+	public function notFound($text)
96
+	{
97
+		$error = ['status' => 404, 'message' => trans('errors.notFound', ['replace' => $text])];
98
+		abort($error['status'], $error['message']);
99
+	}
100
+
101
+	public function generalError()
102
+	{
103
+		$error = ['status' => 400, 'message' => trans('errors.generalError')];
104
+		abort($error['status'], $error['message']);
105
+	}
106 106
 }
107 107
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/V1/Core/Database/Factories/SettingFactory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\V1\Core\Settings::class, function (Faker\Generator $faker) {
4
-    return [
4
+	return [
5 5
 		'id'         => $faker->randomDigitNotNull(),
6 6
 		'name'       => $faker->randomElement(['Company Name', 'Title', 'Header Image']),
7 7
 		'value'      => $faker->word(),
8 8
 		'key'        => $faker->word(),
9 9
 		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
10 10
 		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
11
-    ];
11
+	];
12 12
 });
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\Core\Settings::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\V1\Core\Settings::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
 		'id'         => $faker->randomDigitNotNull(),
6 6
 		'name'       => $faker->randomElement(['Company Name', 'Title', 'Header Image']),
Please login to merge, or discard this patch.
src/Modules/V1/Core/Database/Factories/LogFactory.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $factory->define(App\Modules\V1\Core\Log::class, function (Faker\Generator $faker) {
4
-    return [
4
+	return [
5 5
 		'id'         => $faker->randomDigitNotNull(),
6 6
 		'action'     => $faker->randomElement(['create', 'delete', 'update']),
7 7
 		'item_name ' => $faker->randomElement(['User', 'Settings', 'Group']),
@@ -9,5 +9,5 @@  discard block
 block discarded – undo
9 9
 		'user_id'    => $faker->randomDigitNotNull(),
10 10
 		'created_at' => $faker->dateTimeBetween('-1 years', 'now'),
11 11
 		'updated_at' => $faker->dateTimeBetween('-1 years', 'now')
12
-    ];
12
+	];
13 13
 });
14 14
\ No newline at end of file
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\Core\Log::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\V1\Core\Log::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
 		'id'         => $faker->randomDigitNotNull(),
6 6
 		'action'     => $faker->randomElement(['create', 'delete', 'update']),
Please login to merge, or discard this patch.