<?php

namespace App\Models\Exchange;

use App\Models\AbstractModel;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;

/**
 * Class CompanyEmployee
 * @package App\Models
 *
 * @property \App\Models\Company company_id
 * @property \App\Models\User user_id
 */
class Employee extends AbstractModel
{
    protected $connection = 'exchange_db';

    protected $table = 'employees';

    /**
     * @return HasMany
     */
    public function company(): HasMany
    {
        return $this->HasMany(Company::class, 'company_id', 'id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     **/
    public function user(): HasOne
    {
        return $this->hasOne(User::class, 'user_id', 'id');
    }
}
