Grundgerüst Formulare und Seeder

This commit is contained in:
2026-02-08 17:40:03 +00:00
parent 59fe129fd0
commit 3e765576bf
41 changed files with 914 additions and 94 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Filament\Resources\Contracts\Schemas;
use App\Models\Contact;
use App\Models\User;
use Filament\Forms\Components\MorphToSelect;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;
class ContractForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
TextInput::make('name')
->required(),
TextInput::make('type')
->required(),
Select::make('responsible_id')
->relationship('responsible', 'name')
->required(),
MorphToSelect::make('contractable')
->types([
MorphToSelect\Type::make(User::class)
->titleAttribute('name'),
MorphToSelect\Type::make(Contact::class)
->titleAttribute('name'),
])
]);
}
}