Passed
Push — master ( 1a3424...ba125c )
by Innocent
03:53 queued 44s
created
database/factories/MinistryFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use FaithGen\SDK\Models\Ministry;
6 6
 use Faker\Generator as Faker;
7 7
 
8
-$factory->define(Ministry::class, function (Faker $faker) {
8
+$factory->define(Ministry::class, function(Faker $faker) {
9 9
     return [
10 10
         'name'     => $faker->company,
11 11
         'email'    => $faker->safeEmail,
Please login to merge, or discard this patch.
database/factories/UserFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use FaithGen\SDK\Models\User;
6 6
 use Faker\Generator as Faker;
7 7
 
8
-$factory->define(User::class, function (Faker $faker) {
8
+$factory->define(User::class, function(Faker $faker) {
9 9
     return [
10 10
         //
11 11
     ];
Please login to merge, or discard this patch.
src/FaithGenSDKServiceProvider.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -23,32 +23,32 @@  discard block
 block discarded – undo
23 23
         $this->registerUserAuthRoutes();
24 24
 
25 25
         if ($this->app->runningInConsole()) {
26
-            $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
26
+            $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
27 27
 
28 28
             $this->publishes([
29
-                __DIR__.'/../config/faithgen-sdk.php' => config_path('faithgen-sdk.php'),
29
+                __DIR__ . '/../config/faithgen-sdk.php' => config_path('faithgen-sdk.php'),
30 30
             ], 'faithgen-sdk-config');
31 31
 
32
-            $this->setUpSourceFiles(function () {
32
+            $this->setUpSourceFiles(function() {
33 33
                 $this->publishes([
34
-                    __DIR__.'/../database/migrations/' => database_path('migrations'),
34
+                    __DIR__ . '/../database/migrations/' => database_path('migrations'),
35 35
                 ], 'faithgen-sdk-migrations');
36 36
 
37 37
                 $this->publishes([
38
-                    __DIR__.'/../storage/profile/' => storage_path('app/public/profile'),
38
+                    __DIR__ . '/../storage/profile/' => storage_path('app/public/profile'),
39 39
                 ], 'faithgen-sdk-storage');
40 40
             });
41 41
 
42
-            if (! config('faithgen-sdk.source')) {
42
+            if (!config('faithgen-sdk.source')) {
43 43
                 $this->publishes([
44
-                    __DIR__.'/../storage/users/' => storage_path('app/public/users'),
44
+                    __DIR__ . '/../storage/users/' => storage_path('app/public/users'),
45 45
                 ], 'faithgen-sdk-storage');
46 46
 
47
-                $this->loadFactoriesFrom(__DIR__.'/../database/factories');
47
+                $this->loadFactoriesFrom(__DIR__ . '/../database/factories');
48 48
             }
49 49
 
50 50
             $this->publishes([
51
-                __DIR__.'/../storage/logo/' => public_path('images'),
51
+                __DIR__ . '/../storage/logo/' => public_path('images'),
52 52
             ], 'faithgen-logo');
53 53
         }
54 54
 
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
     private function registerApiRoutes()
74 74
     {
75
-        Route::group($this->apiRouteConfiguration(), function () {
76
-            $this->loadRoutesFrom(__DIR__.'/../routes/api.php');
75
+        Route::group($this->apiRouteConfiguration(), function() {
76
+            $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');
77 77
         });
78 78
     }
79 79
 
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
     private function registerParentRoutes()
94 94
     {
95 95
         if (config('faithgen-sdk.source')) {
96
-            Route::group($this->parentRouteConfiguration(), function () {
97
-                $this->loadRoutesFrom(__DIR__.'/../routes/source.php');
96
+            Route::group($this->parentRouteConfiguration(), function() {
97
+                $this->loadRoutesFrom(__DIR__ . '/../routes/source.php');
98 98
             });
99 99
 
100 100
             $this->registerAuthRoutes();
101 101
 
102
-            $this->loadRoutesFrom(__DIR__.'/../routes/web.php');
102
+            $this->loadRoutesFrom(__DIR__ . '/../routes/web.php');
103 103
         }
104 104
     }
105 105
 
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
     {
108 108
         return [
109 109
             'prefix'     => config('faithgen-sdk.prefix'),
110
-            'middleware' => ['bindings'],
110
+            'middleware' => [ 'bindings' ],
111 111
         ];
112 112
     }
113 113
 
114 114
     private function registerAuthRoutes()
115 115
     {
116
-        Route::group($this->authRouteConfiguration(), function () {
117
-            $this->loadRoutesFrom(__DIR__.'/../routes/auth.php');
116
+        Route::group($this->authRouteConfiguration(), function() {
117
+            $this->loadRoutesFrom(__DIR__ . '/../routes/auth.php');
118 118
         });
119 119
     }
120 120
 
121 121
     private function registerUserAuthRoutes()
122 122
     {
123
-        Route::group($this->authRouteConfiguration(), function () {
124
-            $this->loadRoutesFrom(__DIR__.'/../routes/users-auth.php');
123
+        Route::group($this->authRouteConfiguration(), function() {
124
+            $this->loadRoutesFrom(__DIR__ . '/../routes/users-auth.php');
125 125
         });
126 126
     }
127 127
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function register()
134 134
     {
135
-        $this->mergeConfigFrom(__DIR__.'/../config/faithgen-sdk.php', 'faithgen-sdk');
135
+        $this->mergeConfigFrom(__DIR__ . '/../config/faithgen-sdk.php', 'faithgen-sdk');
136 136
 
137 137
         $this->app->singleton(ProfileService::class);
138 138
         $this->app->singleton(ImageService::class);
Please login to merge, or discard this patch.
routes/auth.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 
6 6
 Route::prefix('auth/')
7 7
     ->name('auth.')
8
-    ->group(function () {
9
-        Route::post('register', [AuthController::class, 'register'])->name('register');
10
-        Route::post('login', [AuthController::class, 'login'])->name('login');
11
-        Route::post('forgot-password', [AuthController::class, 'forgotPassword'])->name('forgotPassword');
12
-        Route::get('resend-activation', [AuthController::class, 'resendActivation'])->name('resendActivation')
8
+    ->group(function() {
9
+        Route::post('register', [ AuthController::class, 'register' ])->name('register');
10
+        Route::post('login', [ AuthController::class, 'login' ])->name('login');
11
+        Route::post('forgot-password', [ AuthController::class, 'forgotPassword' ])->name('forgotPassword');
12
+        Route::get('resend-activation', [ AuthController::class, 'resendActivation' ])->name('resendActivation')
13 13
             ->middleware('auth:api');
14
-        Route::delete('delete-account', [AuthController::class, 'deleteAccount'])->name('deleteAccount')
14
+        Route::delete('delete-account', [ AuthController::class, 'deleteAccount' ])->name('deleteAccount')
15 15
             ->middleware('auth:api');
16
-        Route::get('logout', [AuthController::class, 'logout'])->name('logout')->middleware('auth:api');
16
+        Route::get('logout', [ AuthController::class, 'logout' ])->name('logout')->middleware('auth:api');
17 17
     });
Please login to merge, or discard this patch.
src/Models/Ministry/Profile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 
34 34
     public function getLocationAttribute($location)
35 35
     {
36
-        if (! $location) {
36
+        if (!$location) {
37 37
             return [
38 38
                 'address'     => [
39 39
                     'name'      => 'not-set',
Please login to merge, or discard this patch.
src/Http/Resources/Profile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             'email'     => $this->email,
24 24
             'phone'     => $this->phone,
25 25
             'color'     => $this->profile->color,
26
-            'active'    => (bool) $this->activation->active,
26
+            'active'    => (bool)$this->activation->active,
27 27
             'api_key'   => $this->apiKey->api_key,
28 28
             'avatar'    => ImageHelper::getImage('profile', $this->image, config('faithgen-sdk.ministries-server')),
29 29
             'date'      => Helper::getDates($this->created_at),
Please login to merge, or discard this patch.
src/Http/Resources/MinistryUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     {
13 13
         return [
14 14
             'id'       => $this->user_id,
15
-            'active'   => (bool) $this->active,
15
+            'active'   => (bool)$this->active,
16 16
             'name'     => $this->user->name,
17 17
             'email'    => $this->user->email,
18 18
             'phone'    => $this->user->phone,
Please login to merge, or discard this patch.
src/Http/Controllers/MinistryController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     public function getSocialLink(GetRequest $request)
59 59
     {
60 60
         return response()->json([
61
-            'link' => auth()->user()->profile[$request->platform],
61
+            'link' => auth()->user()->profile[ $request->platform ],
62 62
         ]);
63 63
     }
64 64
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     public function saveSocialLink(UpdateRequest $request)
73 73
     {
74 74
         $profile = auth()->user()->profile;
75
-        $profile[$request->platform] = $request->link;
75
+        $profile[ $request->platform ] = $request->link;
76 76
         try {
77 77
             $profile->save();
78 78
 
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
             $this->deleteFiles(auth()->user());
116 116
         }
117 117
 
118
-        $fileName = str_shuffle(auth()->user()->id.time().time()).'.png';
119
-        $ogSave = storage_path('app/public/profile/original/').$fileName;
118
+        $fileName = str_shuffle(auth()->user()->id . time() . time()) . '.png';
119
+        $ogSave = storage_path('app/public/profile/original/') . $fileName;
120 120
         $imageManager->make($request->image)->save($ogSave);
121
-        $image = auth()->user()->image()->updateOrCreate([], [
121
+        $image = auth()->user()->image()->updateOrCreate([ ], [
122 122
             'name' => $fileName,
123 123
         ]);
124 124
 
@@ -186,27 +186,27 @@  discard block
 block discarded – undo
186 186
      */
187 187
     public function updateProfile(UpdateProfileRequest $request)
188 188
     {
189
-        $ministryParams = $request->only(['name', 'email', 'phone']);
189
+        $ministryParams = $request->only([ 'name', 'email', 'phone' ]);
190 190
 
191 191
         auth()->user()->update($ministryParams);
192 192
 
193
-        $links = ['website', 'facebook', 'youtube', 'twitter', 'instagram'];
194
-        $statements = ['vision', 'mission', 'about_us'];
193
+        $links = [ 'website', 'facebook', 'youtube', 'twitter', 'instagram' ];
194
+        $statements = [ 'vision', 'mission', 'about_us' ];
195 195
 
196
-        $params = ['color' => $request->color];
196
+        $params = [ 'color' => $request->color ];
197 197
 
198 198
         $params = array_merge($params,
199
-            array_filter($request->links, fn ($link) => in_array($link, $links), ARRAY_FILTER_USE_KEY));
199
+            array_filter($request->links, fn($link) => in_array($link, $links), ARRAY_FILTER_USE_KEY));
200 200
 
201 201
         $params = array_merge($params,
202
-            array_filter($request->statement, fn ($link) => in_array($link, $statements), ARRAY_FILTER_USE_KEY));
202
+            array_filter($request->statement, fn($link) => in_array($link, $statements), ARRAY_FILTER_USE_KEY));
203 203
 
204
-        $params = array_merge($params, ['emails' => $request->emails]);
204
+        $params = array_merge($params, [ 'emails' => $request->emails ]);
205 205
 
206
-        $params = array_merge($params, ['phones' => $request->phones]);
206
+        $params = array_merge($params, [ 'phones' => $request->phones ]);
207 207
 
208 208
         if ($request->has('location')) {
209
-            $params = array_merge($params, ['location' => $request->location]);
209
+            $params = array_merge($params, [ 'location' => $request->location ]);
210 210
         }
211 211
 
212 212
         $this->saveServices($request, auth()->user());
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
                 ->whereIn('id', $ministry->services()->pluck('id')->toArray())
228 228
                 ->delete();
229 229
 
230
-            $services = array_map(function ($service) {
230
+            $services = array_map(function($service) {
231 231
                 return array_merge($service, [
232
-                    'id'          => str_shuffle((string) Str::uuid()),
232
+                    'id'          => str_shuffle((string)Str::uuid()),
233 233
                     'ministry_id' => auth()->user()->id,
234 234
                     'created_at'  => now(),
235 235
                     'updated_at'  => now(),
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
      */
249 249
     public function getLinks($links)
250 250
     {
251
-        $_links = ['website', 'facebook', 'youtube', 'twitter', 'instagram'];
251
+        $_links = [ 'website', 'facebook', 'youtube', 'twitter', 'instagram' ];
252 252
 
253 253
         return array_key_exists($links, $_links);
254 254
     }
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
             ->ministryUsers()
277 277
             ->latest()
278 278
             //->with(['user.image'])
279
-            ->where(fn ($ministryUser) => $ministryUser->whereHas('user',
280
-                fn ($user) => $user->search(['name', 'email'], $request->filter_text)))
279
+            ->where(fn($ministryUser) => $ministryUser->whereHas('user',
280
+                fn($user) => $user->search([ 'name', 'email' ], $request->filter_text)))
281 281
             ->paginate(Helper::getLimit($request));
282 282
 
283 283
         //return $ministryUsers;
Please login to merge, or discard this patch.
src/Http/Resources/Ministry.php 1 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
         $results = parent::toArray($request);
20 20
         $results = array_merge($results, [
21
-            'active' => (bool) optional($this->activation)->active,
21
+            'active' => (bool)optional($this->activation)->active,
22 22
             'avatar' => ImageHelper::getImage('profile', $this->image),
23 23
             'level'  => optional($this->account)->level,
24 24
         ]);
Please login to merge, or discard this patch.