diff --git a/app/Console/Commands/Plugin/CreatePluginCommand.php b/app/Console/Commands/Plugin/CreatePluginCommand.php index c9ff00104..e6fea3b01 100644 --- a/app/Console/Commands/Plugin/CreatePluginCommand.php +++ b/app/Console/Commands/Plugin/CreatePluginCommand.php @@ -13,6 +13,7 @@ class CreatePluginCommand extends Command {author} {--description=} {--url=} + {--updateUrl=} {--panels=} {--category=}'; @@ -48,17 +49,18 @@ class CreatePluginCommand extends Command $this->info('Creating Plugin "' . $name . '" (' . $id . ') by ' . $author); $description = $this->option('description') ?? $this->ask('Description'); - $url = $this->option('url') ?? $this->ask('URL', 'https://github.com/' . $author . '/' . $id); - $panels = $this->option('panels') ?? $this->choice('Panels', [ - 'admin' => 'Admin Area', - 'server' => 'Client Area', - 'app' => 'Server List', - ], 'admin,server', multiple: true); $category = $this->option('category') ?? $this->choice('Category', [ 'plugin' => 'Plugin', 'theme' => 'Theme', 'language' => 'Language Pack', ], 'plugin'); + $url = $this->option('url') ?? $this->ask('URL', 'https://github.com/' . $author . '/' . $id); + $updateUrl = $this->option('updateUrl') ?? $this->ask('Update URL', 'https://raw.githubusercontent.com/' . $author . '/' . $id . '/refs/heads/main/update.json'); + $panels = $this->option('panels') ?? $this->choice('Panels', [ + 'admin' => 'Admin Area', + 'server' => 'Client Area', + 'app' => 'Server List', + ], 'admin,server', multiple: true); // Create base directory $this->filesystem->makeDirectory(plugin_path($id)); @@ -75,13 +77,13 @@ class CreatePluginCommand extends Command 'author' => $author, 'version' => '1.0.0', 'description' => $description, + 'category' => $category, 'url' => $url, + 'update_url' => $updateUrl, 'namespace' => $namespace, 'class' => $class, 'panels' => !is_array($panels) ? explode(',', $panels) : $panels, 'panel_version' => config('app.version') === 'canary' ? null : config('app.version'), - 'category' => $category, - 'update_url' => null, ], JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); // Create src directory and create main class diff --git a/app/Models/Plugin.php b/app/Models/Plugin.php index 05d85735f..16b589d0b 100644 --- a/app/Models/Plugin.php +++ b/app/Models/Plugin.php @@ -16,13 +16,13 @@ use Sushi\Sushi; * @property string $author * @property string $version * @property string|null $description + * @property string $category * @property string|null $url + * @property string|null $update_url * @property string $namespace * @property string $class * @property string|null $panels * @property string|null $panel_version - * @property string $category - * @property string|null $update_url * @property PluginStatus $status * @property string|null $status_message * @property int $load_order @@ -48,13 +48,13 @@ class Plugin extends Model implements HasPluginSettings 'author' => 'string', 'version' => 'string', 'description' => 'string', + 'category' => 'string', 'url' => 'string', + 'update_url' => 'string', 'namespace' => 'string', 'class' => 'string', 'panels' => 'string', 'panel_version' => 'string', - 'category' => 'string', - 'update_url' => 'string', 'status' => 'string', 'status_message' => 'string', 'load_order' => 'integer', @@ -68,13 +68,13 @@ class Plugin extends Model implements HasPluginSettings * author: string, * version: string, * description: string, + * category: string, * url: string, + * update_url: string, * namespace: string, * class: string, * panels: string, * panel_version: string, - * category: string, - * update_url: string, * status: string, * status_message: string, * load_order: int