Fix Server model to use correct relationship when returning subusers, closes #1589
This commit is contained in:
parent
fe9d86b66b
commit
58796e7441
|
@ -13,6 +13,7 @@ value when showing an error state.
|
||||||
* Database host management will now properly display an error message to the user when there is any type of MySQL related
|
* Database host management will now properly display an error message to the user when there is any type of MySQL related
|
||||||
error encountered during creation or update.
|
error encountered during creation or update.
|
||||||
* Two-factor tokens generated when a company name has a space in it will now properly be parsed on iOS authenticator devices.
|
* Two-factor tokens generated when a company name has a space in it will now properly be parsed on iOS authenticator devices.
|
||||||
|
* Fixed 500 error when trying to request subuser's from a server in the application API.
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
* Server listing view now displays the total used disk space for each server.
|
* Server listing view now displays the total used disk space for each server.
|
||||||
|
|
|
@ -156,11 +156,11 @@ class Server extends Model implements CleansAttributes, ValidableContract
|
||||||
/**
|
/**
|
||||||
* Gets the subusers associated with a server.
|
* Gets the subusers associated with a server.
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||||
*/
|
*/
|
||||||
public function subusers()
|
public function subusers()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Subuser::class);
|
return $this->hasManyThrough(User::class, Subuser::class, 'server_id', 'id', 'id', 'user_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue