<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
use Illuminate\Database\Eloquent\SoftDeletes;


/**
 * Class CompanyEmployee
 * @package App\Models
 * @version August 4, 2020, 4:21 am
 *
 * @property string name
 * @property integer type
 */
class CompanyEmployee extends AbstractModel
{

    use SoftDeletes;

    protected $table = 'company_employees';
    
    protected $dates = ['deleted_at'];

    public $fillable = [
        'user_id'
    ];

    /**
     * @return HasOneThrough
     */
    public function company(): hasOneThrough
    {
        return $this->hasOneThrough(Company::class, CompanyModule::class);
    }

    public function user(): belongsTo
    {
        return $this->belongsTo(User::class);
    }

    

}
