Files
opensem/app/Models/Botanic/Variety.php
2021-11-01 18:37:25 +01:00

37 lines
825 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;
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('App\Models\Botanic\Specie');
}
public function Articles()
{
return $this->morphMany('App\Models\Shop\Article', 'product');
}
public function tags()
{
return $this->morphToMany('App\Models\Shop\Tag', 'taggable');
}
}