Change Permission & WIP Dashboard Client Portal

This commit is contained in:
Fajar
2023-04-06 15:30:22 +07:00
parent 4a7c3ebdda
commit 85039893a8
1497 changed files with 2808 additions and 2508 deletions

14
app/Models/Corporate.php Executable file → Normal file
View File

@@ -30,7 +30,7 @@ class Corporate extends Model
protected $appends = [
'avatar_url',
];
protected $hidden = [
'created_at',
'updated_at',
@@ -73,8 +73,6 @@ class Corporate extends Model
public function currentPolicy()
{
return $this->hasOne(CorporatePolicy::class)
// ->where('start', '<=', now())
// ->where('end', '>=', now())
->where('active', true)
->latestOfMany();
}
@@ -106,7 +104,10 @@ class Corporate extends Model
]);
}
// public function
public function claims()
{
return $this->hasManyThrough(Claim::class, CorporateEmployee::class, 'corporate_id', 'member_id', 'id', 'member_id');
}
public function importLogs()
{
@@ -123,11 +124,6 @@ class Corporate extends Model
return $this->hasManyThrough(CorporateService::class, Service::class, 'corporate_id', 'service_code', 'id', 'service_code');
}
// public function claims()
// {
// return $this->hasManyThrough()
// }
public function corporateServices()
{
return $this->hasMany(CorporateService::class, 'corporate_id');