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

@@ -12,6 +12,9 @@ use Wildside\Userstamps\Userstamps;
use App\Traits\Model\Imageable;
use App\Models\Shop\Article;
use App\Models\Shop\Tag;
class Variety extends Model implements HasMedia
{
use Imageable, PowerJoins, SoftDeletes, Taggable, UserStamps;
@@ -21,16 +24,16 @@ class Variety extends Model implements HasMedia
public function Specie()
{
return $this->belongsTo('App\Models\Botanic\Specie');
return $this->belongsTo(Specie::class);
}
public function Articles()
{
return $this->morphMany('App\Models\Shop\Article', 'product');
return $this->morphMany(Article::class, 'product');
}
public function tags()
{
return $this->morphToMany('App\Models\Shop\Tag', 'taggable');
return $this->morphToMany(Tag::class, 'taggable');
}
}