This commit is contained in:
ct
2025-08-11 02:35:35 +08:00
parent 4a80723243
commit f3c91b9a64
24 changed files with 2035 additions and 214 deletions

View File

@@ -24,7 +24,10 @@ public function shot(Request $request): JsonResponse
'delay' => 'integer|min:0|max:30000',
'block_ads' => 'boolean',
'block_cookie_banners' => 'boolean',
'block_trackers' => 'boolean'
'block_trackers' => 'boolean',
'webhook_url' => 'nullable|url|max:2048',
'webhook_events_filter' => 'nullable|array',
'webhook_events_filter.*' => 'in:queued,processing,completed,failed'
]);
$uuid = Str::uuid()->toString();
@@ -34,6 +37,8 @@ public function shot(Request $request): JsonResponse
'type' => 'shot',
'url' => $validated['url'],
'status' => 'queued',
'webhook_url' => $validated['webhook_url'] ?? null,
'webhook_events_filter' => isset($validated['webhook_events_filter']) ? $validated['webhook_events_filter'] : ['queued', 'processing', 'completed', 'failed'],
'parameters' => array_filter([
'viewport_width' => $validated['viewport_width'] ?? 1920,
'viewport_height' => $validated['viewport_height'] ?? 1080,