Merge pull request #5299 from devansh-webkul/s3-bucket

Slider Issue Fixed For S3 Bucket #5284
This commit is contained in:
Devansh 2021-11-03 18:14:35 +05:30 committed by GitHub
commit c8140e13a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 29 additions and 9 deletions

View File

@ -15,6 +15,18 @@ class Slider extends Model implements SliderContract
*/
protected $table = 'sliders';
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = ['image_url'];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'title',
'path',
@ -27,11 +39,13 @@ class Slider extends Model implements SliderContract
/**
* Get image url for the category image.
*
* @return string
*/
public function image_url()
{
if (! $this->path) {
return;
return '';
}
return Storage::url($this->path);
@ -39,6 +53,8 @@ class Slider extends Model implements SliderContract
/**
* Get image url for the category image.
*
* @return string
*/
public function getImageUrlAttribute()
{

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=9731ecdc1df78464d45a",
"/js/shop.js": "/js/shop.js?id=7da13680877af8a5dfc3",
"/css/shop.css": "/css/shop.css?id=09fe143fc28a83a41b59"
}

View File

@ -77,7 +77,7 @@ export default {
this.slides.forEach(function(slider) {
self.images.push({
'path': self.public_path + '/storage/' + slider.path,
'path': slider.image_url,
'title' : slider.title,
'slider_path': slider.slider_path ? slider.slider_path : null
});

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
{
"/js/velocity.js": "/js/velocity.js?id=2fe1b3c650803a0782b3",
"/js/velocity.js": "/js/velocity.js?id=2cdc157a54b0f9ee9d7b",
"/js/velocity-core.js": "/js/velocity-core.js?id=5c0fe2bf195ee94576fd",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=4322502d80a0e4a0affd",
"/css/velocity.css": "/css/velocity.css?id=b5766995aee5d5324ddd"

View File

@ -26,7 +26,11 @@
>
<img
class="col-12 no-padding banner-icon"
:src="`${$root.baseUrl}/storage/${banner.path}`"
:src="
banner.image_url != ''
? banner.image_url
: defaultBanner
"
/>
<div