true]); } if (! config('jwt.secret')) { Artisan::call('jwt:secret', ['--force' => true]); } Artisan::call($this->option('fresh') ? 'migrate:fresh' : 'migrate', ['--force' => true]); $this->output->write(Artisan::output()); Artisan::call('db:seed', ['--force' => true]); $this->output->write(Artisan::output()); User::query()->updateOrCreate([ 'email' => (string) $this->option('admin-email'), ], [ 'name' => '系统管理员', 'role' => 'admin', 'is_active' => true, 'password' => Hash::make((string) $this->option('admin-password')), ]); Storage::put('installed.lock', now()->toIso8601String()); $this->info('QuickQuiz installed.'); return self::SUCCESS; } }