<?php

namespace Modules\Mall\Models;

use App\Models\Model;
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Modules\Mall\Models\Traits\BelongsToShop;

class Tag extends Model
{

    use BelongsToShop,
        Cachable;

    protected $table = 'mall_tags';

    /**
     * Notes   : 标签下的商品
     * @Date   : 2021/5/12 10:14 上午
     * @Author : < Jason.C >
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function goods(): BelongsToMany
    {
        return $this->belongsToMany(Goods::class, 'mall_goods_tag')->withTimestamps();
    }

}