chore: commit remaining workspace changes

This commit is contained in:
2026-05-08 21:51:29 +02:00
parent 8d108b8a76
commit ff96ef796e
97 changed files with 18020 additions and 2196 deletions

View File

@@ -20,8 +20,31 @@ class UpsertAcademyPromptTemplateRequest extends FormRequest
'featured' => $this->boolean('featured'),
'prompt_of_week' => $this->boolean('prompt_of_week'),
'active' => $this->boolean('active', true),
'new_category_name' => trim((string) $this->input('new_category_name', '')),
'tags' => array_values(array_filter((array) $this->input('tags', []))),
'tool_notes' => (array) $this->input('tool_notes', []),
'tool_notes' => collect($this->input('tool_notes', []))
->filter(static fn ($note): bool => is_array($note) || is_string($note))
->map(function ($note): array|string {
if (is_string($note)) {
return $note;
}
return [
'provider' => $note['provider'] ?? null,
'model_name' => $note['model_name'] ?? null,
'notes' => $note['notes'] ?? null,
'strengths' => $note['strengths'] ?? null,
'weaknesses' => $note['weaknesses'] ?? null,
'best_for' => $note['best_for'] ?? null,
'image_path' => $note['image_path'] ?? null,
'thumb_path' => $note['thumb_path'] ?? null,
'settings' => $note['settings'] ?? null,
'score' => filled($note['score'] ?? null) ? (int) $note['score'] : null,
'active' => filter_var($note['active'] ?? true, FILTER_VALIDATE_BOOL, FILTER_NULL_ON_FAILURE) ?? true,
];
})
->values()
->all(),
]);
}
@@ -31,6 +54,7 @@ class UpsertAcademyPromptTemplateRequest extends FormRequest
return [
'category_id' => ['nullable', 'integer', 'exists:academy_categories,id'],
'new_category_name' => ['nullable', 'string', 'max:120'],
'title' => ['required', 'string', 'max:180'],
'slug' => ['required', 'string', 'max:180', Rule::unique('academy_prompt_templates', 'slug')->ignore($promptId)],
'excerpt' => ['nullable', 'string'],
@@ -44,6 +68,17 @@ class UpsertAcademyPromptTemplateRequest extends FormRequest
'tags' => ['nullable', 'array'],
'tags.*' => ['string', 'max:60'],
'tool_notes' => ['nullable', 'array'],
'tool_notes.*.provider' => ['nullable', 'string', 'max:100'],
'tool_notes.*.model_name' => ['nullable', 'string', 'max:150'],
'tool_notes.*.notes' => ['nullable', 'string'],
'tool_notes.*.strengths' => ['nullable', 'string'],
'tool_notes.*.weaknesses' => ['nullable', 'string'],
'tool_notes.*.best_for' => ['nullable', 'string'],
'tool_notes.*.image_path' => ['nullable', 'string', 'max:500'],
'tool_notes.*.thumb_path' => ['nullable', 'string', 'max:500'],
'tool_notes.*.settings' => ['nullable', 'string'],
'tool_notes.*.score' => ['nullable', 'integer', 'min:1', 'max:10'],
'tool_notes.*.active' => ['nullable', 'boolean'],
'preview_image' => ['nullable', 'string', 'max:2048'],
'preview_image_file' => ['nullable', 'file', 'image', 'mimes:jpg,jpeg,png,webp', 'max:5120'],
'featured' => ['required', 'boolean'],