mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-22 22:14:26 +00:00
update: return number of order when login.
This commit is contained in:
@@ -6,6 +6,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
@@ -56,6 +58,15 @@ class CompanyModule extends AbstractModel
|
||||
return $this->belongsToMany(User::class, (new CompanyEmployee())->getTable(), 'company_module_id', 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany
|
||||
*/
|
||||
public function orders(): HasMany
|
||||
{
|
||||
return $this->HasMany(Order::class, 'company_module_id');
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * @return HasMany
|
||||
// */
|
||||
|
||||
Reference in New Issue
Block a user