Merge branch 'affiliate-program' of https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0 into vapor/development

# Conflicts:
#	routes/api.php
This commit is contained in:
Edmond Lang
2025-11-30 23:34:31 +08:00
50 changed files with 2427 additions and 6 deletions
+10
View File
@@ -121,4 +121,14 @@ class User extends AbstractModel implements
{
return $this->morphMany(KeyValuePair::class, 'owner');
}
/**
* @return BelongsToMany
*/
public function affiliates(): BelongsToMany
{
return $this->belongsToMany(Affiliate::class, 'user_affiliates', 'user_id', 'affiliate_id')
->withPivot('clicked_at', 'registered_at')
->withTimestamps();
}
}