Completed
Push — master ( eb7f3e...7140fe )
by Sherif
02:49
created
src/Modules/V1/Reporting/Database/Seeds/ClearDataSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function run()
13 13
     {
14
-        $permissions  = DB::table('permissions')->whereIn('model', ['reports']);
14
+        $permissions = DB::table('permissions')->whereIn('model', ['reports']);
15 15
         DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
16 16
         $permissions->delete();
17 17
     }
Please login to merge, or discard this patch.
src/Modules/V1/Reporting/Database/Seeds/AssignRelationsSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 		 * Assign the permissions to the admin group.
16 16
 		 */
17 17
     	$adminGroupId = DB::table('groups')->whereIn('name', 'admin')->select('id')->first()->id;
18
-        DB::table('permissions')->whereIn('model', ['reports'])->each(function ($permission) use ($adminGroupId) {
18
+        DB::table('permissions')->whereIn('model', ['reports'])->each(function($permission) use ($adminGroupId) {
19 19
         	DB::table('groups_permissions')->insert(
20 20
 				[
21 21
 				'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/V1/Acl/Database/seeds/AssignRelationsSeeder.php 1 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/Repositories/UserRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $user        = \Core::users()->find(\JWTAuth::parseToken()->authenticate()->id, $relations);
27 27
         foreach ($user->groups()->get() as $group)
28 28
         {
29
-            $group->permissions->each(function ($permission) use (&$permissions){
29
+            $group->permissions->each(function($permission) use (&$permissions){
30 30
                 $permissions[$permission->model][$permission->id] = $permission->name;
31 31
             });
32 32
         }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @param  boolean $user
45 45
      * @return boolean
46 46
      */
47
-    public function can($nameOfPermission, $model, $user = false )
47
+    public function can($nameOfPermission, $model, $user = false)
48 48
     {      
49 49
         $user        = $user ?: \JWTAuth::parseToken()->authenticate();
50 50
         $permissions = [];
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             \ErrorHandler::tokenExpired();
55 55
         }
56 56
 
57
-        $user->groups->pluck('permissions')->each(function ($permission) use (&$permissions, $model){
57
+        $user->groups->pluck('permissions')->each(function($permission) use (&$permissions, $model){
58 58
             $permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray()); 
59 59
         });
60 60
         
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function assignGroups($user_id, $group_ids)
84 84
     {
85
-        \DB::transaction(function () use ($user_id, $group_ids) {
85
+        \DB::transaction(function() use ($user_id, $group_ids) {
86 86
             $user = $this->find($user_id);
87 87
             $user->groups()->detach();
88 88
             $user->groups()->attach($group_ids);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
         $url   = $this->config['resetLink'];
246 246
         $token = \Password::getRepository()->create($user);
247 247
         
248
-        \Mail::send('Acl:resetpassword', ['user' => $user, 'url' => $url, 'token' => $token], function ($m) use ($user) {
248
+        \Mail::send('Acl:resetpassword', ['user' => $user, 'url' => $url, 'token' => $token], function($m) use ($user) {
249 249
             $m->to($user->email, $user->name)->subject('Your Password Reset Link');
250 250
         });
251 251
     }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     public function resetPassword($credentials)
260 260
     {
261 261
         $token    = false;
262
-        $response = \Password::reset($credentials, function ($user, $password) use (&$token) {
262
+        $response = \Password::reset($credentials, function($user, $password) use (&$token) {
263 263
             $user->password = bcrypt($password);
264 264
             $user->save();
265 265
 
Please login to merge, or discard this patch.
src/Modules/V1/Core/Database/Factories/SettingFactory.php 1 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 1 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.
src/Modules/V1/Core/Console/Commands/GenerateDoc.php 1 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/Reporting/Database/Factories/ReportFactory.php 1 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\Reporting\Report::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\V1\Reporting\Report::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
 		'id'          => $faker->randomDigitNotNull(),
6 6
 		'report_name' => $faker->randomElement(['Users Count', 'Low Stock Products', 'Active Users']),
Please login to merge, or discard this patch.
src/Modules/V1/Notifications/Database/Factories/NotificationFactory.php 1 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\Notifications\Notification::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\V1\Notifications\Notification::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
 		'id'          => $faker->randomDigitNotNull(),
6 6
 		'key'         => $faker->randomElement(['low_stock', 'order_added', 'new_request']),
Please login to merge, or discard this patch.