From be404a83327dc2f7713253168bac9b7c27c15292 Mon Sep 17 00:00:00 2001 From: Boy132 Date: Mon, 4 Aug 2025 11:17:48 +0200 Subject: [PATCH] add artisan command to update plugin --- .../Commands/Plugin/UpdatePluginCommand.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 app/Console/Commands/Plugin/UpdatePluginCommand.php diff --git a/app/Console/Commands/Plugin/UpdatePluginCommand.php b/app/Console/Commands/Plugin/UpdatePluginCommand.php new file mode 100644 index 000000000..16fa40eb7 --- /dev/null +++ b/app/Console/Commands/Plugin/UpdatePluginCommand.php @@ -0,0 +1,36 @@ +argument('id'))->first(); + + if (!$plugin) { + $this->error('Plugin does not exist!'); + + return; + } + + if (!$plugin->isUpdateAvailable()) { + $this->error("Plugin doesn't need updating!"); + + return; + } + + Plugins::updatePlugin($plugin); + + $this->info('Plugin updated.'); + } +}