Add plus on products

This commit is contained in:
Ludovic CANDELLIER
2022-04-25 20:02:28 +02:00
parent 5747b93952
commit d8bf91da54
15 changed files with 263 additions and 47 deletions

View File

@@ -10,6 +10,8 @@ use Rinvex\Tags\Traits\Taggable;
use Spatie\MediaLibrary\HasMedia;
use App\Traits\Model\Imageable;
use App\Models\Shop\Tag;
use App\Models\Shop\Article;
class Specie extends Model implements HasMedia
{
@@ -20,7 +22,7 @@ class Specie extends Model implements HasMedia
public function tags()
{
return $this->morphToMany('App\Models\Shop\Tag', 'taggable');
return $this->morphToMany(Tag::class, 'taggable');
}
public function Genre()
@@ -35,7 +37,7 @@ class Specie extends Model implements HasMedia
public function Articles()
{
return $this->morphMany('App\Models\Shop\Article', 'product');
return $this->morphMany(Article::class, 'product');
}
public function scopeByName($query, $name)