mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Add users relation to company model (#3032)
* fixes for invoice footer" * Add users relation to company model
This commit is contained in:
parent
2759fb4b72
commit
74f416cd2d
@ -100,7 +100,9 @@ class Company extends BaseModel
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(CompanyUser::class);
|
||||
|
||||
return $this->hasManyThrough(User::class, CompanyUser::class, 'company_id', 'id', 'id', 'user_id');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,6 +55,11 @@ class CompanyUser extends Pivot
|
||||
return $this->hasOne(Company::class, 'id', 'company_id');
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
|
||||
/*todo monitor this function - may fail under certain conditions*/
|
||||
public function token()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user