repository = $repository; } /** * Delete all orphaned API keys from the database when upgrading from 0.6 to 0.7. * * @return void|null */ public function handle() { $count = $this->repository->findCountWhere([['key_type', '=', ApiKey::TYPE_NONE]]); $continue = $this->confirm( 'This action will remove ' . $count . ' keys from the database. Are you sure you wish to continue?', false ); if (! $continue) { return null; } $this->info('Deleting keys...'); $this->repository->deleteWhere([['key_type', '=', ApiKey::TYPE_NONE]]); $this->info('Keys were successfully deleted.'); } }