<?php

namespace Modules\User\Models;

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

class Service extends Model
{

    use Cachable,
        HasStatus,
        SoftDeletes,
        HasCovers;

    protected $table = 'user_services';

    /**
     * Notes   : 不同的客服匹配不同的身份
     * @Date   : 2021/6/07 10:40
     * @Author : Mr.wang
     * @return BelongsToMany
     */
    public function identities(): BelongsToMany
    {
        return $this->belongsToMany(Identity::class, 'user_service_identity')
                    ->withTimestamps();
    }

}
