['name' => 'Markup', 'flux_icon_name' => 'code-bracket', 'detail_view_route' => 'plugins.markup'], 'api' => ['name' => 'API', 'flux_icon_name' => 'braces', 'detail_view_route' => 'plugins.api'], ]; protected $rules = [ 'name' => 'required|string|max:255', 'data_stale_minutes' => 'required|integer|min:1', 'data_strategy' => 'required|string|in:polling,webhook,static', 'polling_url' => 'required_if:data_strategy,polling|nullable|url', 'polling_verb' => 'required|string|in:get,post', 'polling_header' => 'nullable|string|max:255', 'polling_body' => 'nullable|string', ]; public function refreshPlugins(): void { $userPlugins = auth()->user()?->plugins?->map(function ($plugin) { return $plugin->toArray(); })->toArray(); $this->plugins = array_merge($this->native_plugins, $userPlugins ?? []); } public function mount(): void { $this->refreshPlugins(); } public function addPlugin(): void { abort_unless(auth()->user() !== null, 403); $this->validate(); \App\Models\Plugin::create([ 'uuid' => Str::uuid(), 'user_id' => auth()->id(), 'name' => $this->name, 'data_stale_minutes' => $this->data_stale_minutes, 'data_strategy' => $this->data_strategy, 'polling_url' => $this->polling_url ?? null, 'polling_verb' => $this->polling_verb, 'polling_header' => $this->polling_header, 'polling_body' => $this->polling_body, ]); $this->reset(['name', 'data_stale_minutes', 'data_strategy', 'polling_url', 'polling_verb', 'polling_header', 'polling_body']); $this->refreshPlugins(); Flux::modal('add-plugin')->close(); } public function seedExamplePlugins(): void { Artisan::call(ExampleRecipesSeederCommand::class, ['user_id' => auth()->id()]); $this->refreshPlugins(); } public function importZip(PluginImportService $pluginImportService): void { abort_unless(auth()->user() !== null, 403); $this->validate([ 'zipFile' => 'required|file|mimes:zip|max:10240', // 10MB max ]); try { $plugin = $pluginImportService->importFromZip($this->zipFile, auth()->user()); $this->refreshPlugins(); $this->reset(['zipFile']); Flux::modal('import-zip')->close(); } catch (\Exception $e) { $this->addError('zipFile', 'Error installing plugin: ' . $e->getMessage()); } } }; ?>
settings.yml and full.liquid files.The ZIP file should contain the following structure:
--}} {{----}}
{{--.--}}
{{--├── src--}}
{{--│ ├── full.liquid (required)--}}
{{--│ ├── settings.yml (required)--}}
{{--│ └── ...--}}
{{--└── ...--}}
{{-- --}}
date: "%N" is unsupported. Use date: "u" instead