<?php

namespace Modules\Mall\Models;

use App\Models\Model;
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class Reason extends Model
{

    use Cachable,
        SoftDeletes;

    protected $table = 'mall_reasons';

    /**
     * Notes: 关联店铺
     * @Author: 玄尘
     * @Date  : 2021/5/18 15:28
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function shops(): BelongsToMany
    {
        return $this->belongsToMany(Shop::class, 'mall_shop_reasons')
                    ->withTimestamps();
    }

}
