mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 12:34:01 +00:00
48 lines
879 B
PHP
48 lines
879 B
PHP
<?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);
|
|
}
|
|
|
|
|
|
|
|
}
|