mirror of
https://github.com/nihonbuzz/nihonbuzz-academy.git
synced 2026-01-26 05:25:37 +07:00
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Courses\Schemas;
|
|
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Components\Textarea;
|
|
use Filament\Forms\Components\Toggle;
|
|
use Filament\Schemas\Schema;
|
|
|
|
class CourseForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
Select::make('teacher_id')
|
|
->relationship('teacher', 'name')
|
|
->required(),
|
|
TextInput::make('title')
|
|
->required(),
|
|
TextInput::make('slug')
|
|
->required(),
|
|
Textarea::make('description')
|
|
->columnSpanFull(),
|
|
TextInput::make('level')
|
|
->required()
|
|
->default('N5'),
|
|
TextInput::make('price')
|
|
->required()
|
|
->numeric()
|
|
->default(0)
|
|
->prefix('$'),
|
|
TextInput::make('thumbnail_url')
|
|
->url(),
|
|
Toggle::make('is_published')
|
|
->required(),
|
|
Textarea::make('metadata')
|
|
->columnSpanFull(),
|
|
]);
|
|
}
|
|
}
|