@@ -44,8 +44,8 @@ |
||
44 | 44 | $this->mergeConfigFrom(__DIR__.'/../config/responsive-gallery.php', 'responsive-gallery'); |
45 | 45 | |
46 | 46 | $this->app->bind('gallery-index', function(){ |
47 | - return new ResponsiveGalleryFactory(); |
|
48 | - }); |
|
47 | + return new ResponsiveGalleryFactory(); |
|
48 | + }); |
|
49 | 49 | |
50 | 50 | |
51 | 51 | } |
@@ -19,18 +19,18 @@ discard block |
||
19 | 19 | ], 'js'); |
20 | 20 | |
21 | 21 | $this->publishes([ |
22 | - __DIR__ . '/../config/responsive-gallery.php' => base_path('config/responsive-gallery.php') |
|
22 | + __DIR__.'/../config/responsive-gallery.php' => base_path('config/responsive-gallery.php') |
|
23 | 23 | ], 'config'); |
24 | 24 | |
25 | - if (! class_exists('CreateGalleryImagesTable')) { |
|
25 | + if (!class_exists('CreateGalleryImagesTable')) { |
|
26 | 26 | $this->publishes([ |
27 | 27 | __DIR__.'/../database/migrations/create_gallery_images_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_gallery_images_table.php'), |
28 | 28 | ], 'migrations'); |
29 | 29 | } |
30 | 30 | |
31 | - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laravel-responsive-gallery'); |
|
31 | + $this->loadViewsFrom(__DIR__.'/../resources/views', 'laravel-responsive-gallery'); |
|
32 | 32 | $this->publishes([ |
33 | - __DIR__ . '/../resources/views' => resource_path('views/vendor/laravel-responsive-gallery/') |
|
33 | + __DIR__.'/../resources/views' => resource_path('views/vendor/laravel-responsive-gallery/') |
|
34 | 34 | ]); |
35 | 35 | |
36 | 36 | Route::group(['middleware' => 'web'], function() { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | $this->mergeConfigFrom(__DIR__.'/../config/responsive-gallery.php', 'responsive-gallery'); |
45 | 45 | |
46 | - $this->app->bind('gallery-index', function(){ |
|
46 | + $this->app->bind('gallery-index', function() { |
|
47 | 47 | return new ResponsiveGalleryFactory(); |
48 | 48 | }); |
49 | 49 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $thumbs_height = $thumbs_size['height']; |
100 | 100 | |
101 | 101 | // Create thumbs dir |
102 | - if (! is_dir($thumbs_dir)) { |
|
102 | + if (!is_dir($thumbs_dir)) { |
|
103 | 103 | mkdir($thumbs_dir); |
104 | 104 | } |
105 | 105 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | foreach ($image_files as $index=>$file) { |
110 | 110 | $index++; |
111 | 111 | $thumbnail_image = $thumbs_dir.$file; |
112 | - if (! file_exists($thumbnail_image)) { |
|
112 | + if (!file_exists($thumbnail_image)) { |
|
113 | 113 | $extension = $this->get_file_extension($thumbnail_image); |
114 | 114 | if ($extension) { |
115 | 115 | //echo $images_dir." ".$file." ".$thumbnail_image." ".$thumbs_width; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | **/ |
132 | 132 | public function createImagesArray($image_files, $image_data, $gallery_url) |
133 | 133 | { |
134 | - sort($image_files); // Order by image name |
|
134 | + sort($image_files); // Order by image name |
|
135 | 135 | |
136 | 136 | $ret = []; |
137 | 137 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | |
298 | 298 | // if photo has datas return the datas |
299 | 299 | $ret = null; |
300 | - if (!empty($photosDatas[$photoFileName])){ |
|
300 | + if (!empty($photosDatas[$photoFileName])) { |
|
301 | 301 | $ret['description'] = $photosDatas[$photoFileName]->description; |
302 | 302 | $ret['video_link'] = $photosDatas[$photoFileName]->video_link; |
303 | 303 | $ret['alt'] = $photosDatas[$photoFileName]->alt; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $image_files = $this->getImageFiles($parameters['images_dir']); |
325 | 325 | //sort($image_files,SORT_STRING); |
326 | 326 | |
327 | - if (! empty($image_files)) { |
|
327 | + if (!empty($image_files)) { |
|
328 | 328 | // Get images data from excel |
329 | 329 | //$image_data = $this->getImgDataFromExcel($parameters['images_dir']); |
330 | 330 | $image_data = null; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | //return ResponsiveGallery::getRandomQuote(); |
14 | 14 | $galleryImages = GalleryImage::orderBy('file_name')->paginate(20); |
15 | - return view('vendor.laravel-responsive-gallery.index',compact('galleryImages')) |
|
15 | + return view('vendor.laravel-responsive-gallery.index', compact('galleryImages')) |
|
16 | 16 | ->with('i', (request()->input('page', 1) - 1) * 20); |
17 | 17 | } |
18 | 18 | |
@@ -22,22 +22,22 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @return \Illuminate\Http\Response |
24 | 24 | */ |
25 | - public function index(Request $request){ |
|
25 | + public function index(Request $request) { |
|
26 | 26 | |
27 | 27 | $searchKeywords = $request->input('keywords'); |
28 | 28 | |
29 | - if ($searchKeywords){ |
|
29 | + if ($searchKeywords) { |
|
30 | 30 | $galleryImages = GalleryImage::orderBy('file_name') |
31 | - ->where('file_name', 'like', '%' . $request->input('keywords') . '%') |
|
31 | + ->where('file_name', 'like', '%'.$request->input('keywords').'%') |
|
32 | 32 | ->paginate(20); |
33 | 33 | } |
34 | 34 | else |
35 | 35 | $galleryImages = GalleryImage::orderBy('file_name') |
36 | 36 | ->paginate(20); |
37 | 37 | |
38 | - return view('vendor.laravel-responsive-gallery.index',compact('galleryImages')) |
|
38 | + return view('vendor.laravel-responsive-gallery.index', compact('galleryImages')) |
|
39 | 39 | ->with('i', (request()->input('page', 1) - 1) * 20) |
40 | - ->with('searchKeywords',$searchKeywords); |
|
40 | + ->with('searchKeywords', $searchKeywords); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /***************************************************************************/ |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return \Illuminate\Http\Response |
48 | 48 | */ |
49 | - public function create(){ |
|
49 | + public function create() { |
|
50 | 50 | return view('vendor.laravel-responsive-gallery.create'); |
51 | 51 | } |
52 | 52 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param \Illuminate\Http\Request $request |
58 | 58 | * @return \Illuminate\Http\Response |
59 | 59 | */ |
60 | - public function store(Request $request){ |
|
60 | + public function store(Request $request) { |
|
61 | 61 | |
62 | 62 | // Validate form datas |
63 | 63 | $validator = Validator::make($request->all(), [ |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | * @param \App\Country $country |
87 | 87 | * @return \Illuminate\Http\Response |
88 | 88 | */ |
89 | - public function show(GalleryImage $galleryImage){ |
|
90 | - return view('vendor.laravel-responsive-gallery.show',compact('galleryImage')); |
|
89 | + public function show(GalleryImage $galleryImage) { |
|
90 | + return view('vendor.laravel-responsive-gallery.show', compact('galleryImage')); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /***************************************************************************/ |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | * @param \App\Country $country |
98 | 98 | * @return \Illuminate\Http\Response |
99 | 99 | */ |
100 | - public function edit($id = null){ |
|
100 | + public function edit($id = null) { |
|
101 | 101 | |
102 | 102 | $galleryImage = GalleryImage::find($id); |
103 | 103 | |
104 | - return view('vendor.laravel-responsive-gallery.edit',compact('galleryImage')); |
|
104 | + return view('vendor.laravel-responsive-gallery.edit', compact('galleryImage')); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /***************************************************************************/ |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * @param \App\Country $country |
113 | 113 | * @return \Illuminate\Http\Response |
114 | 114 | */ |
115 | - public function update(Request $request, $id){ |
|
115 | + public function update(Request $request, $id) { |
|
116 | 116 | request()->validate([ |
117 | 117 | 'file_name' => 'required', |
118 | 118 | ]); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @param \App\Country $country |
133 | 133 | * @return \Illuminate\Http\Response |
134 | 134 | */ |
135 | - public function destroy($id){ |
|
135 | + public function destroy($id) { |
|
136 | 136 | |
137 | 137 | $galleryImage = GalleryImage::find($id); |
138 | 138 | $galleryImage->delete(); |
@@ -30,10 +30,10 @@ |
||
30 | 30 | $galleryImages = GalleryImage::orderBy('file_name') |
31 | 31 | ->where('file_name', 'like', '%' . $request->input('keywords') . '%') |
32 | 32 | ->paginate(20); |
33 | - } |
|
34 | - else |
|
35 | - $galleryImages = GalleryImage::orderBy('file_name') |
|
33 | + } else { |
|
34 | + $galleryImages = GalleryImage::orderBy('file_name') |
|
36 | 35 | ->paginate(20); |
36 | + } |
|
37 | 37 | |
38 | 38 | return view('vendor.laravel-responsive-gallery.index',compact('galleryImages')) |
39 | 39 | ->with('i', (request()->input('page', 1) - 1) * 20) |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | - /* public $guarded = []; |
|
18 | + /* public $guarded = []; |
|
19 | 19 | |
20 | 20 | public $casts = [ |
21 | 21 | 'serialized_event' => 'array', |