feat: add Image Webhook plugin

This commit is contained in:
Benjamin Nussbaum 2026-01-05 18:09:39 +01:00
parent 809965e81c
commit 3def60ae3e
11 changed files with 817 additions and 7 deletions

View file

@ -29,8 +29,24 @@ class PluginFactory extends Factory
'icon_url' => null,
'flux_icon_name' => null,
'author_name' => $this->faker->name(),
'plugin_type' => 'recipe',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];
}
/**
* Indicate that the plugin is an image webhook plugin.
*/
public function imageWebhook(): static
{
return $this->state(fn (array $attributes): array => [
'plugin_type' => 'image_webhook',
'data_strategy' => 'static',
'data_stale_minutes' => 60,
'polling_url' => null,
'polling_verb' => 'get',
'name' => $this->faker->randomElement(['Camera Feed', 'Security Camera', 'Webcam', 'Image Stream']),
]);
}
}

View file

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('plugins', function (Blueprint $table): void {
$table->string('plugin_type')->default('recipe')->after('uuid');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('plugins', function (Blueprint $table): void {
$table->dropColumn('plugin_type');
});
}
};