@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | public function indexPopup() |
| 15 | 15 | { |
| 16 | 16 | $popups = config('adminetic.caching', true) |
| 17 | - ? (Cache::has('popups') ? Cache::get('popups') : Cache::rememberForever('popups', function () { |
|
| 17 | + ? (Cache::has('popups') ? Cache::get('popups') : Cache::rememberForever('popups', function() { |
|
| 18 | 18 | return Popup::latest()->get(); |
| 19 | 19 | })) |
| 20 | 20 | : Popup::latest()->get(); |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | 'image' => request()->image->store('website/popup', 'public') |
| 68 | 68 | ]); |
| 69 | 69 | if (request()->file('image')->getClientOriginalExtension() == 'gif') { |
| 70 | - $imageName = time() . '.' . request()->image->extension(); |
|
| 70 | + $imageName = time().'.'.request()->image->extension(); |
|
| 71 | 71 | |
| 72 | 72 | request()->image->move(public_path('website/popup'), $imageName); |
| 73 | 73 | } else { |
| 74 | 74 | $image = Image::make(request()->file('image')->getRealPath()); |
| 75 | - $image->save(public_path('storage/' . $popup->image)); |
|
| 75 | + $image->save(public_path('storage/'.$popup->image)); |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $id = $this->popup->id ?? ''; |
| 40 | 40 | return [ |
| 41 | - 'code' => 'required|unique:popups,code,' . $id, |
|
| 41 | + 'code' => 'required|unique:popups,code,'.$id, |
|
| 42 | 42 | 'name' => 'nullable|max:255', |
| 43 | 43 | 'image' => 'nullable|file|image|max:3000', |
| 44 | 44 | 'body' => 'nullable|max:5500', |
@@ -17,15 +17,15 @@ |
||
| 17 | 17 | { |
| 18 | 18 | parent::boot(); |
| 19 | 19 | |
| 20 | - static::saving(function () { |
|
| 20 | + static::saving(function() { |
|
| 21 | 21 | self::cacheKey(); |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | - static::deleting(function () { |
|
| 24 | + static::deleting(function() { |
|
| 25 | 25 | self::cacheKey(); |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | - Popup::creating(function ($model) { |
|
| 28 | + Popup::creating(function($model) { |
|
| 29 | 29 | $model->position = Popup::max('position') + 1; |
| 30 | 30 | }); |
| 31 | 31 | } |