mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-25 23:43:58 +00:00
Merge branch 'affiliate-program' of https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0 into vapor/development
# Conflicts: # routes/api.php
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user