mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 04:23:59 +00:00
big commit
This commit is contained in:
@@ -18,11 +18,12 @@ class CompanyResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$companyModule = $this->modules->first();
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'account_no' => $this->reference_no,
|
||||
'marking' => CompanyConnections::where('module_one', $this->modules->first()->id)->first()->marking,
|
||||
'email' => $this->employees->first()->email,
|
||||
'marking' => CompanyConnections::where('module_one', $companyModule->id)->first()->marking,
|
||||
'email' => $companyModule->employees->first()->email,
|
||||
'name' => $this->name,
|
||||
'type' => $this->type,
|
||||
'status' => (int) $this->status,
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Classes\General\Interfaces\Documentable;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
@@ -60,13 +59,6 @@ class Company extends AbstractModel implements Documentable
|
||||
return $this->hasMany(CompanyModule::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return belongsToMany
|
||||
*/
|
||||
public function employees(): belongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, (new CompanyEmployee())->getTable(), 'company_id','user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasManyThrough
|
||||
|
||||
Reference in New Issue
Block a user