<?php

namespace Modules\User\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Modules\User\Traits\BelongsToUser;

class IdentityMiddle extends Pivot
{

    use BelongsToUser;

    protected $table      = 'user_identity';
    protected $primaryKey = 'user_id';
    public    $dates      = [
        'started_at', 'ended_at'
    ];

    static function boot()
    {
        parent::boot();


    }

    public function identity(): BelongsTo
    {
        return $this->belongsTo(Identity::class, 'identity_id');
    }

}