28 lines
838 B
PHP
28 lines
838 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Inhaltsverzeichnis\Schemas;
|
|
|
|
use App\Models\TextblockKennung;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Schemas\Schema;
|
|
|
|
class InhaltsverzeichnisForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
TextInput::make('ordnungszahl')->numeric(),
|
|
Select::make('textblock_kennung_id')
|
|
->label('Textblock Art')
|
|
->options(function () {
|
|
$relatedOptions = TextblockKennung::all()->pluck('name', 'id')->toArray();
|
|
|
|
return ['0' => 'ohne Textblock'] + $relatedOptions;
|
|
}),
|
|
TextInput::make('name'),
|
|
])->columns(1);
|
|
}
|
|
}
|