Passed
Push — master ( 7382ce...822fa2 )
by Saeid
04:09
created
src/MediaServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     public function boot()
15 15
     {
16 16
         $this->loadRoutesFrom(__DIR__.'/routes/web.php');
17
-        $this->loadMigrationsFrom(__DIR__ . '/database/migrations');
17
+        $this->loadMigrationsFrom(__DIR__.'/database/migrations');
18 18
         $this->loadViewsFrom(__DIR__.'/resources/views', 'media');
19 19
         $this->mergeConfigFrom(
20 20
             __DIR__.'/config/media.php', 'media'
Please login to merge, or discard this patch.
src/Http/Controllers/MediaController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,6 @@
 block discarded – undo
18 18
         $medium = Medium::create([
19 19
             'file' => $request->file('photo'),
20 20
         ]);
21
-        return back()->with('url' , $medium->url('sm'));
21
+        return back()->with('url', $medium->url('sm'));
22 22
     }
23 23
 }
Please login to merge, or discard this patch.
src/database/migrations/2019_01_22_083452_create_media_table.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('media', function (Blueprint $table) {
16
+        Schema::create('media', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('stored_name');
19 19
             $table->string('file_name');
20
-            $table->string('extension',5);
20
+            $table->string('extension', 5);
21 21
             $table->string('caption')->nullable();
22
-            $table->string('mime',30);
22
+            $table->string('mime', 30);
23 23
             $table->integer('size');
24 24
             $table->integer('width')->nullable();
25 25
             $table->integer('height')->nullable();
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             $table->string('manner')->nullable();
30 30
             $table->integer('comments_count')->default(0);
31 31
             $table->integer('likes_count')->default(0);
32
-            $table->string('description',500)->nullable();
32
+            $table->string('description', 500)->nullable();
33 33
             $table->timestamps();
34 34
         });
35 35
     }
Please login to merge, or discard this patch.
src/config/media.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
      *  Responsive image sizes
19 19
      */
20 20
 
21
-    'LARGE_IMAGE_SIZE'      => 0,   //determine that the image store in original size
21
+    'LARGE_IMAGE_SIZE'      => 0, //determine that the image store in original size
22 22
     'MEDIUM_IMAGE_SIZE'     => 540, // It will save the image in 540x540 pixels
23 23
     'SMALL_IMAGE_SIZE'      => 270, // It will save the image in 270x270 pixels
24 24
     'EXTRA_SMALL_IMAGE_SIZE'=> 135, // It will save the image in 135x135 pixels
Please login to merge, or discard this patch.
src/routes/web.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-Route::group(['namespace'=>'Khaleghi\Media\Http\Controllers', 'middleware' => 'web'], function(){
3
+Route::group(['namespace'=>'Khaleghi\Media\Http\Controllers', 'middleware' => 'web'], function() {
4 4
 
5
-    Route::get('media/create','MediaController@create');
6
-    Route::post('media','MediaController@store')->name('media.store');
5
+    Route::get('media/create', 'MediaController@create');
6
+    Route::post('media', 'MediaController@store')->name('media.store');
7 7
 });
8 8
 
Please login to merge, or discard this patch.
src/Medium.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             File::isDirectory($medium_image_folder) or File::makeDirectory($medium_image_folder, 0777, true, true);
40 40
             File::isDirectory($small_image_folder) or File::makeDirectory($small_image_folder, 0777, true, true);
41 41
             File::isDirectory($extra_small_image_folder) or File::makeDirectory($extra_small_image_folder, 0777, true, true);
42
-        }else {
42
+        } else {
43 43
             $path = storage_path('app/'.$this->main_upload_folder."/{$this->type}s/");
44 44
             File::isDirectory($path) or File::makeDirectory($path, 0777, true, true);
45 45
         }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                 Image::make($this->file_object)
103 103
                     ->widen(config('media.LARGE_IMAGE_SIZE'))
104 104
                     ->save(storage_path('app/'.$this->full_path_lg.'/'.$stored_name));
105
-            }else {
105
+            } else {
106 106
                 $this->file_object->storeAs($this->full_path_lg, $stored_name);
107 107
             }
108 108
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                     ->widen(config('media.EXTRA_SMALL_IMAGE_SIZE'))
121 121
                     ->save(storage_path('app/'.$this->full_path_xs.'/'.$this->stored_name));
122 122
             }
123
-        }elseif ($this->is($this->type)) {
123
+        } elseif ($this->is($this->type)) {
124 124
             $this->file_object->storeAs(config('media.MAIN_UPLOAD_FOLDER').'/'.$this->type.'s', $stored_name);
125 125
         }
126 126
     }
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
                 Storage::delete($this->full_path_md.'/'.$this->stored_name);
133 133
                 Storage::delete($this->full_path_sm.'/'.$this->stored_name);
134 134
                 Storage::delete($this->full_path_xs.'/'.$this->stored_name);
135
-            }else {
135
+            } else {
136 136
                 Storage::delete($this->full_path.'/'.$this->stored_name);
137 137
             }
138 138
             return true;
139
-        }else {
139
+        } else {
140 140
             return false;
141 141
         }
142 142
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     public function url($image_size = 'lg') {
145 145
         if ($this->is('image')) {
146 146
             return Storage::url($this->main_upload_folder."/images/{$image_size}/".$this->stored_name);
147
-        }else {
147
+        } else {
148 148
             return Storage::url($this->main_upload_folder."/{$this->type}s/".$this->stored_name);
149 149
         }
150 150
     }
Please login to merge, or discard this patch.