Passed
Push — master ( dc648e...bd5a58 )
by Innocent
15:18
created
database/migrations/2019_09_04_145002_create_albums_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('fg_albums', function (Blueprint $table) {
16
+        Schema::create('fg_albums', function(Blueprint $table) {
17 17
             $table->string('id', 150)->primary();
18 18
             $table->string('ministry_id', 150)->index();
19 19
             $table->string('name');
Please login to merge, or discard this patch.
src/Models/Album.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,6 +47,6 @@
 block discarded – undo
47 47
 
48 48
     public function getImageDimensions()
49 49
     {
50
-        return [0, 100];
50
+        return [ 0, 100 ];
51 51
     }
52 52
 }
Please login to merge, or discard this patch.
src/Providers/GalleryServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,21 +19,21 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function boot()
21 21
     {
22
-        $this->registerRoutes(__DIR__.'/../../routes/gallery.php', __DIR__.'/../../routes/source.php');
22
+        $this->registerRoutes(__DIR__ . '/../../routes/gallery.php', __DIR__ . '/../../routes/source.php');
23 23
 
24
-        $this->setUpSourceFiles(function () {
25
-            $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
24
+        $this->setUpSourceFiles(function() {
25
+            $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
26 26
             $this->publishes([
27
-                __DIR__.'/../../storage/gallery/' => storage_path('app/public/gallery'),
27
+                __DIR__ . '/../../storage/gallery/' => storage_path('app/public/gallery'),
28 28
             ], 'faithgen-gallery-storage');
29 29
 
30 30
             $this->publishes([
31
-                __DIR__.'/../../database/migrations/' => database_path('migrations'),
31
+                __DIR__ . '/../../database/migrations/' => database_path('migrations'),
32 32
             ], 'faithgen-gallery-migrations');
33 33
         });
34 34
 
35 35
         $this->publishes([
36
-            __DIR__.'/../../config/faithgen-gallery.php' => config_path('faithgen-gallery.php'),
36
+            __DIR__ . '/../../config/faithgen-gallery.php' => config_path('faithgen-gallery.php'),
37 37
         ], 'faithgen-gallery-config');
38 38
 
39 39
         Album::observe(AlbumObserver::class);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function register()
48 48
     {
49
-        $this->mergeConfigFrom(__DIR__.'/../../config/faithgen-gallery.php', 'faithgen-gallery');
49
+        $this->mergeConfigFrom(__DIR__ . '/../../config/faithgen-gallery.php', 'faithgen-gallery');
50 50
 
51 51
         $this->app->singleton(AlbumService::class);
52 52
     }
Please login to merge, or discard this patch.
src/Policies/AlbumPolicy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function create(Ministry $user)
45 45
     {
46
-        $albumsCount = Album::where('ministry_id', $user->id)->whereBetween('created_at', [Carbon::now()->firstOfMonth(), Carbon::now()->lastOfMonth()])->count();
46
+        $albumsCount = Album::where('ministry_id', $user->id)->whereBetween('created_at', [ Carbon::now()->firstOfMonth(), Carbon::now()->lastOfMonth() ])->count();
47 47
 
48 48
         return $this->getAuthorization($user, $albumsCount, 'albums');
49 49
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         } else {
81 81
             return self::getAuthorization($ministry, $albumSize, 'images');
82 82
             $allow = self::getAuthorization($ministry, $albumSize, 'images');
83
-            if (! $allow) {
83
+            if (!$allow) {
84 84
                 return false;
85 85
             } else {
86 86
                 if ($ministry->account->level === 'Free') {
Please login to merge, or discard this patch.
src/Services/AlbumService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function getUnsetFields(): array
44 44
     {
45
-        return ['album_id'];
45
+        return [ 'album_id' ];
46 46
     }
47 47
 
48 48
     public function getParentRelationship()
Please login to merge, or discard this patch.
src/Http/Requests/DeleteImageRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      */
28 28
     public function rules()
29 29
     {
30
-        return [];
30
+        return [ ];
31 31
     }
32 32
 
33 33
     public function failedAuthorization()
Please login to merge, or discard this patch.
src/Http/Requests/GetRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      */
33 33
     public function rules()
34 34
     {
35
-        return [];
35
+        return [ ];
36 36
     }
37 37
 
38 38
     public function failedAuthorization()
Please login to merge, or discard this patch.
src/Http/Controllers/AlbumController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function index(IndexRequest $request)
49 49
     {
50
-        $albums = $this->albumService->getParentRelationship()->where('name', 'LIKE', '%'.$request->filter_text.'%')
50
+        $albums = $this->albumService->getParentRelationship()->where('name', 'LIKE', '%' . $request->filter_text . '%')
51 51
             ->latest()
52 52
             ->paginate($request->has('limit') ? $request->limit : 15);
53 53
 
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function addImage(AddImagesRequest $request, ImageManager $imageManager)
124 124
     {
125
-        $fileName = str_shuffle($this->albumService->getAlbum()->id.time().time()).'.png';
126
-        $ogSave = storage_path('app/public/gallery/original/').$fileName;
125
+        $fileName = str_shuffle($this->albumService->getAlbum()->id . time() . time()) . '.png';
126
+        $ogSave = storage_path('app/public/gallery/original/') . $fileName;
127 127
 
128 128
         $imageManager->make($request->file('images'))->save($ogSave);
129 129
 
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
         $image = $this->albumService->getAlbum()->images()->findOrFail($image_id);
152 152
 
153 153
         try {
154
-            unlink(storage_path('app/public/gallery/100-100/'.$image->name));
155
-            unlink(storage_path('app/public/gallery/original/'.$image->name));
154
+            unlink(storage_path('app/public/gallery/100-100/' . $image->name));
155
+            unlink(storage_path('app/public/gallery/original/' . $image->name));
156 156
             $image->delete();
157 157
 
158 158
             return $this->successResponse('Image deleted!');
Please login to merge, or discard this patch.
routes/source.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@
 block discarded – undo
6 6
 Route::name('albums.')
7 7
     ->prefix('albums/')
8 8
     ->middleware('source.site')
9
-    ->group(function () {
10
-        Route::post('', [AlbumController::class, 'create']);
11
-        Route::post('{album}/add-images', [AlbumController::class, 'addImage']);
12
-        Route::put('/update/{album}', [AlbumController::class, 'update']);
13
-        Route::delete('{album}', [AlbumController::class, 'destroy']);
14
-        Route::delete('{album}/delete-image/{image_id}', [AlbumController::class, 'destroyImage']);
9
+    ->group(function() {
10
+        Route::post('', [ AlbumController::class, 'create' ]);
11
+        Route::post('{album}/add-images', [ AlbumController::class, 'addImage' ]);
12
+        Route::put('/update/{album}', [ AlbumController::class, 'update' ]);
13
+        Route::delete('{album}', [ AlbumController::class, 'destroy' ]);
14
+        Route::delete('{album}/delete-image/{image_id}', [ AlbumController::class, 'destroyImage' ]);
15 15
     });
Please login to merge, or discard this patch.