Multi-images component, refactoring medias functions
This commit is contained in:
@@ -12,12 +12,12 @@ trait Imageable
|
||||
|
||||
public function images()
|
||||
{
|
||||
return $this->hasMany('App\Models\Core\Media', 'model_id')->where('model_type', get_class($this));
|
||||
return $this->hasMany(Media::class, 'model_id')->where('model_type', get_class($this));
|
||||
}
|
||||
|
||||
public function image()
|
||||
{
|
||||
return $this->hasOne('App\Models\Core\Media', 'model_id')->where('model_type', get_class($this))->latest();
|
||||
return $this->hasOne(Media::class, 'model_id')->where('model_type', get_class($this))->latest();
|
||||
}
|
||||
|
||||
public function registerMediaConversions(Media $media = null) : void
|
||||
|
||||
Reference in New Issue
Block a user