Add subuser deletion service
This commit is contained in:
parent
74ea1aa0aa
commit
2cabb61b54
6 changed files with 276 additions and 1 deletions
|
@ -25,7 +25,9 @@
|
|||
namespace Pterodactyl\Repositories\Eloquent;
|
||||
|
||||
use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface;
|
||||
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||
use Pterodactyl\Models\Subuser;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
class SubuserRepository extends EloquentRepository implements SubuserRepositoryInterface
|
||||
{
|
||||
|
@ -36,4 +38,19 @@ class SubuserRepository extends EloquentRepository implements SubuserRepositoryI
|
|||
{
|
||||
return Subuser::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getWithServerAndPermissions($id)
|
||||
{
|
||||
Assert::numeric($id, 'First argument passed to getWithServerAndPermissions must be numeric, received %s.');
|
||||
|
||||
$instance = $this->getBuilder()->with(['server', 'permission'])->find($id, $this->getColumns());
|
||||
if (! $instance) {
|
||||
throw new RecordNotFoundException;
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue