Display total servers user can access in the Admin CP

closes #356
This commit is contained in:
Dane Everitt 2017-04-13 23:49:47 -04:00
parent 23e6e0510b
commit 6fda3b72e4
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 17 additions and 5 deletions

View file

@ -239,4 +239,14 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
{
return $this->hasMany(Server::class, 'owner_id');
}
/**
* Return all servers that user is listed as a subuser of directly.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function subuserOf()
{
return $this->hasMany(Subuser::class);
}
}