Files
opensem/app/Models/Botanic/Variety.php
Ludovic CANDELLIER d8bf91da54 Add plus on products
2022-04-25 20:02:28 +02:00

40 lines
844 B
PHP

<?php
namespace App\Models\Botanic;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\MediaLibrary\HasMedia;
use Rinvex\Tags\Traits\Taggable;
use Kirschbaum\PowerJoins\PowerJoins;
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;
protected $guarded = ['id'];
protected $table = 'botanic_varieties';
public function Specie()
{
return $this->belongsTo(Specie::class);
}
public function Articles()
{
return $this->morphMany(Article::class, 'product');
}
public function tags()
{
return $this->morphToMany(Tag::class, 'taggable');
}
}