mirror of
https://github.com/nihonbuzz/nihonbuzz-academy.git
synced 2026-01-26 13:32:07 +07:00
feat: implement Notion-like LMS (Course Player, Exam, Certificate) with R2 integration
This commit is contained in:
@@ -27,12 +27,37 @@ class LessonForm
|
||||
Textarea::make('content')
|
||||
->columnSpanFull(),
|
||||
TextInput::make('video_url')
|
||||
->url(),
|
||||
TextInput::make('content_pdf'),
|
||||
->url()
|
||||
->placeholder('https://youtube.com/watch?v=...')
|
||||
->visible(fn (callable $get) => $get('type') === 'video'),
|
||||
|
||||
\Filament\Forms\Components\SpatieMediaLibraryFileUpload::make('content_pdf')
|
||||
->collection('content_pdf')
|
||||
->disk('r2')
|
||||
->visibility('public')
|
||||
->acceptedFileTypes(['application/pdf'])
|
||||
->label('Upload PDF Material')
|
||||
->visible(fn (callable $get) => $get('type') === 'pdf'),
|
||||
|
||||
// Legacy URL input if needed, or remove. Keeping it hidden if empty?
|
||||
// Let's keep it as an alternative or just replace it.
|
||||
// Assuming we want to fully switch to upload:
|
||||
// TextInput::make('content_pdf')->label('PDF URL (Legacy)'),
|
||||
|
||||
TextInput::make('duration_seconds')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
->default(0)
|
||||
->suffix('Seconds'),
|
||||
|
||||
\Filament\Forms\Components\SpatieMediaLibraryFileUpload::make('attachments')
|
||||
->collection('attachments')
|
||||
->disk('r2')
|
||||
->visibility('public')
|
||||
->multiple()
|
||||
->downloadable()
|
||||
->label('Attachments (Downloadable Resources)'),
|
||||
|
||||
Toggle::make('is_free_preview')
|
||||
->required(),
|
||||
TextInput::make('order_index')
|
||||
@@ -40,7 +65,8 @@ class LessonForm
|
||||
->numeric()
|
||||
->default(0),
|
||||
Textarea::make('metadata')
|
||||
->columnSpanFull(),
|
||||
->columnSpanFull()
|
||||
->rows(5),
|
||||
Select::make('vocabularies')
|
||||
->relationship('vocabularies', 'word')
|
||||
->multiple()
|
||||
|
||||
Reference in New Issue
Block a user