mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-21 13:34:08 +00:00
bulk commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\AbstractModel as Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
|
||||
/**
|
||||
* Class CompanyModule
|
||||
* @package App\Models
|
||||
* @version August 4, 2020, 4:21 am
|
||||
*
|
||||
* @property string name
|
||||
* @property integer type
|
||||
*/
|
||||
class CompanyModule extends AbstractModel
|
||||
{
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'company_modules';
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
|
||||
public $fillable = [
|
||||
'module_type'
|
||||
];
|
||||
|
||||
/**
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function company(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return belongsToMany
|
||||
*/
|
||||
public function employees(): belongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, (new CompanyEmployee())->getTable(), 'module_id','user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsToMany
|
||||
*/
|
||||
public function connections(): belongsToMany
|
||||
{
|
||||
return $this->belongsToMany(CompanyModule::class, (new CompanyConnections())->getTable(), 'module_one', 'module_two');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user