ExtensionUpdateCommand.php 815 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Dcat\Admin\Console;
  3. use Dcat\Admin\Admin;
  4. use Illuminate\Console\Command;
  5. class ExtensionUpdateCommand extends Command
  6. {
  7. protected $signature = 'admin:extension-update
  8. {name : The name of the extension. Eg: author-name/extension-name}
  9. {--ver= : If this parameter is specified, the process will stop on the specified version, if not, it will update to the latest version. Example: 1.3.9}';
  10. protected $description = 'Update an existing extension.';
  11. public function handle()
  12. {
  13. $name = $this->argument('name');
  14. $version = $this->option('ver');
  15. Admin::extension()->load();
  16. Admin::extension()
  17. ->updateManager()
  18. ->setOutPut($this->output)
  19. ->update($name, $version);
  20. }
  21. }