Add producers
This commit is contained in:
31
app/Models/Shop/Producer.php
Normal file
31
app/Models/Shop/Producer.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
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 Producer extends Model implements HasMedia
|
||||
{
|
||||
use Imageable, PowerJoins, SoftDeletes, Taggable, UserStamps;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_producers';
|
||||
|
||||
public function Merchandises()
|
||||
{
|
||||
return $this->morphMany(Article::class, 'product');
|
||||
}
|
||||
|
||||
public function tags()
|
||||
{
|
||||
return $this->morphToMany(Tag::class, 'taggable');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user