fix pterodactyl:user command
This commit is contained in:
parent
7222754580
commit
73d153cacb
1 changed files with 13 additions and 4 deletions
|
@ -25,7 +25,8 @@
|
|||
namespace Pterodactyl\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Pterodactyl\Repositories\oldUserRepository;
|
||||
use Pterodactyl\Repositories\UserRepository;
|
||||
use Pterodactyl\Services\Users\UserCreationService;
|
||||
|
||||
class MakeUser extends Command
|
||||
{
|
||||
|
@ -49,12 +50,20 @@ class MakeUser extends Command
|
|||
*/
|
||||
protected $description = 'Create a user within the panel.';
|
||||
|
||||
/**
|
||||
* @var \Pterodactyl\Services\Users\UserCreationService
|
||||
*/
|
||||
protected $creationService;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct(
|
||||
UserCreationService $creationService
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->creationService = $creationService;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,8 +87,8 @@ class MakeUser extends Command
|
|||
$data['root_admin'] = is_null($this->option('admin')) ? $this->confirm('Is this user a root administrator?') : $this->option('admin');
|
||||
|
||||
try {
|
||||
$user = new oldUserRepository;
|
||||
$user->create($data);
|
||||
|
||||
$this->creationService->handle($data);
|
||||
|
||||
return $this->info('User successfully created.');
|
||||
} catch (\Exception $ex) {
|
||||
|
|
Loading…
Reference in a new issue