argument('email'))); $password = Str::password(24, true, true, false, false); $u = User::firstOrNew(['email' => $email]); $u->name = $this->option('name'); $u->is_admin = true; $u->email_verified_at = now(); if (! $u->exists) { $u->password = Hash::make($password); } $u->save(); $this->info("Administrator ready: {$email}"); if (! $u->wasRecentlyCreated) { $this->line('Existing password retained.'); } else { $this->warn("Temporary password (shown once): {$password}"); } return self::SUCCESS; } }