<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;

/**
 * Class CompanyEmployee
 * @package App\Models
 *
 * @property \App\Models\companyModule company_module_id
 * @property \App\Models\User user_id
 * @property integer role_id
 * @property integer status
 */
class CompanyEmployee extends AbstractModel
{
    protected $table = 'company_employees';

    /**
     * @return HasMany
     */
    public function companyModule(): HasMany
    {
        return $this->HasMany(CompanyModule::class, 'company_module_id', 'id');
    }

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