mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-27 16:34:27 +00:00
new: assign segment to company created. #1
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
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 $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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user