<?php

namespace App\Models\Shop;

use App\Traits\Model\Imageable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Kirschbaum\PowerJoins\PowerJoins;
use Rinvex\Tags\Traits\Taggable;
use Spatie\MediaLibrary\HasMedia;
use Wildside\Userstamps\Userstamps;

class Producer extends Model implements HasMedia
{
    use Imageable, PowerJoins, SoftDeletes, Taggable, UserStamps;

    protected $guarded = ['id'];

    protected $table = 'shop_producers';

    public function Articles()
    {

    }

    public function Merchandises(): HasMany
    {
        return $this->hasMany(Merchandise::class);
    }

    public function tags(): MorphToMany
    {
        return $this->morphToMany(Tag::class, 'taggable');
    }
}
