mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Still throwing errors, but trying to fix the docblock
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
dd5f256450
commit
ea644f8d47
|
@ -3,14 +3,29 @@
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use \App\Models\User;
|
||||||
|
|
||||||
|
|
||||||
class CreateAdmin extends Command
|
class CreateAdmin extends Command
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/** @mixin User **/
|
||||||
/**
|
/**
|
||||||
* The name and signature of the console command.
|
* App\Console\CreateAdmin
|
||||||
*
|
* @property mixed $first_name
|
||||||
* @var string
|
* @property string $last_name
|
||||||
|
* @property string $username
|
||||||
|
* @property string $email
|
||||||
|
* @property string $permissions
|
||||||
|
* @property string $password
|
||||||
|
* @property boolean $activated
|
||||||
|
* @property boolean $show_in_list
|
||||||
|
* @property \Illuminate\Support\Carbon|null $created_at
|
||||||
|
* @property mixed $created_by
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected $signature = 'snipeit:create-admin {--first_name=} {--last_name=} {--email=} {--username=} {--password=} {show_in_list?}';
|
protected $signature = 'snipeit:create-admin {--first_name=} {--last_name=} {--email=} {--username=} {--password=} {show_in_list?}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,11 +45,7 @@ class CreateAdmin extends Command
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$first_name = $this->option('first_name');
|
$first_name = $this->option('first_name');
|
||||||
|
@ -47,7 +58,7 @@ class CreateAdmin extends Command
|
||||||
if (($first_name == '') || ($last_name == '') || ($username == '') || ($email == '') || ($password == '')) {
|
if (($first_name == '') || ($last_name == '') || ($username == '') || ($email == '') || ($password == '')) {
|
||||||
$this->info('ERROR: All fields are required.');
|
$this->info('ERROR: All fields are required.');
|
||||||
} else {
|
} else {
|
||||||
$user = new \App\Models\User;
|
$user = new User;
|
||||||
$user->first_name = $first_name;
|
$user->first_name = $first_name;
|
||||||
$user->last_name = $last_name;
|
$user->last_name = $last_name;
|
||||||
$user->username = $username;
|
$user->username = $username;
|
||||||
|
|
Loading…
Reference in a new issue