Add plus on products
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user