mirror of
https://github.com/nihonbuzz/nihonbuzz-academy.git
synced 2026-01-26 13:32:07 +07:00
feat: update seeder with real YouTube video URLs and update technical blueprint
This commit is contained in:
@@ -2,8 +2,11 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources\Vocabularies\Schemas;
|
||||
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class VocabularyForm
|
||||
@@ -12,20 +15,63 @@ class VocabularyForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('word')
|
||||
->required(),
|
||||
TextInput::make('reading'),
|
||||
TextInput::make('romaji'),
|
||||
TextInput::make('meaning_en'),
|
||||
TextInput::make('meaning_id'),
|
||||
TextInput::make('level_id'),
|
||||
TextInput::make('audio_url')
|
||||
->url(),
|
||||
TextInput::make('type'),
|
||||
Textarea::make('stroke_order_svg')
|
||||
->columnSpanFull(),
|
||||
Textarea::make('example_sentences')
|
||||
->columnSpanFull(),
|
||||
Section::make('Core Info')
|
||||
->schema([
|
||||
TextInput::make('word')
|
||||
->label('Word (Kanji/Kana)')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('reading')
|
||||
->label('Reading (Kana)')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('romaji')
|
||||
->maxLength(255),
|
||||
TextInput::make('meaning_id')
|
||||
->label('Meaning (Bahasa Indonesia)')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('meaning_en')
|
||||
->label('Meaning (English)')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
])->columns(2),
|
||||
|
||||
Section::make('Metadata & Media')
|
||||
->schema([
|
||||
Select::make('level_id')
|
||||
->label('JLPT Level')
|
||||
->relationship('level', 'code')
|
||||
->searchable()
|
||||
->preload()
|
||||
->required(),
|
||||
Select::make('type')
|
||||
->options([
|
||||
'noun' => 'Noun',
|
||||
'verb' => 'Verb',
|
||||
'adjective' => 'Adjective',
|
||||
'adverb' => 'Adverb',
|
||||
'particle' => 'Particle',
|
||||
'expression' => 'Expression',
|
||||
])
|
||||
->required(),
|
||||
FileUpload::make('audio_url')
|
||||
->label('Pronunciation Audio')
|
||||
->disk('r2')
|
||||
->directory('audio/vocab')
|
||||
->visibility('public')
|
||||
->acceptedFileTypes(['audio/mpeg', 'audio/wav', 'audio/ogg']),
|
||||
])->columns(2),
|
||||
|
||||
Section::make('Advanced')
|
||||
->schema([
|
||||
Textarea::make('stroke_order_svg')
|
||||
->label('Stroke Order SVG (JSON)')
|
||||
->columnSpanFull(),
|
||||
Textarea::make('example_sentences')
|
||||
->label('Example Sentences (JSON)')
|
||||
->columnSpanFull(),
|
||||
])->collapsed(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user