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

@@ -69,6 +69,18 @@ class UpsertAcademyLessonRequest extends FormRequest
->all();
$this->merge([
'lesson_number' => $this->filled('lesson_number') ? (int) $this->input('lesson_number') : null,
'course_order' => $this->filled('course_order') ? (int) $this->input('course_order') : null,
'content_source' => in_array((string) $this->input('content_source'), ['html', 'markdown'], true)
? (string) $this->input('content_source')
: ($this->filled('content_markdown') ? 'markdown' : 'html'),
'course_ids' => collect($this->input('course_ids', []))
->filter(static fn ($courseId): bool => filled($courseId))
->map(static fn ($courseId): int => (int) $courseId)
->unique()
->values()
->all(),
'tags' => array_values(array_filter((array) $this->input('tags', []))),
'reading_minutes' => $this->filled('reading_minutes') ? (int) $this->input('reading_minutes') : 5,
'featured' => $this->boolean('featured'),
'active' => $this->boolean('active', true),
@@ -84,12 +96,22 @@ class UpsertAcademyLessonRequest extends FormRequest
'category_id' => ['nullable', 'integer', 'exists:academy_categories,id'],
'title' => ['required', 'string', 'max:180'],
'slug' => ['required', 'string', 'max:180', Rule::unique('academy_lessons', 'slug')->ignore($lessonId)],
'lesson_number' => ['nullable', 'integer', 'min:1'],
'course_order' => ['nullable', 'integer', 'min:1'],
'course_ids' => ['nullable', 'array'],
'course_ids.*' => ['integer', 'exists:academy_courses,id'],
'series_name' => ['nullable', 'string', 'max:120'],
'excerpt' => ['nullable', 'string'],
'content' => ['nullable', 'string'],
'content_markdown' => ['nullable', 'string'],
'content_source' => ['required', 'string', Rule::in(['html', 'markdown'])],
'difficulty' => ['required', 'string', Rule::in((array) config('academy.difficulty_levels', []))],
'access_level' => ['required', 'string', Rule::in(['free', 'creator', 'pro'])],
'lesson_type' => ['required', 'string', 'max:80'],
'cover_image' => ['nullable', 'string', 'max:2048'],
'article_cover_image' => ['nullable', 'string', 'max:2048'],
'tags' => ['nullable', 'array'],
'tags.*' => ['string', 'max:60'],
'video_url' => ['nullable', 'string', 'max:2048'],
'reading_minutes' => ['required', 'integer', 'min:1', 'max:999'],
'featured' => ['required', 'boolean'],