class RequestDomainPage extends Page implements HasForms
{
use InteractsWithForms;
protected static ?string $model = RequestDomain::class;
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.request-domain-page';
protected static ?string $title = 'Domein aanvragen';
public $domain;
public $customer_id;
public function mount(): void
{
$this->form->fill();
}
protected function getFormSchema(): array
{
return [
Card::make()->schema([
TextInput::make('domain')
->label('Domain')
->required(),
Select::make('customer_id')
->label('Customer')
->placeholder('Select Customer')
->options(
\App\Models\Customer::all()->pluck('name', 'id')
)
->required(),
])
];
}
protected function getFormActions(): array
{
return [
Action::make('kak')
->label('Submit')
->action(function (RequestDomain $requestDomain) {
RequestDomain::create([
'domain' => $this->domain,
'customer_id' => $this->customer_id
]);
}),
];
}
}
class RequestDomainPage extends Page implements HasForms
{
use InteractsWithForms;
protected static ?string $model = RequestDomain::class;
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.request-domain-page';
protected static ?string $title = 'Domein aanvragen';
public $domain;
public $customer_id;
public function mount(): void
{
$this->form->fill();
}
protected function getFormSchema(): array
{
return [
Card::make()->schema([
TextInput::make('domain')
->label('Domain')
->required(),
Select::make('customer_id')
->label('Customer')
->placeholder('Select Customer')
->options(
\App\Models\Customer::all()->pluck('name', 'id')
)
->required(),
])
];
}
protected function getFormActions(): array
{
return [
Action::make('kak')
->label('Submit')
->action(function (RequestDomain $requestDomain) {
RequestDomain::create([
'domain' => $this->domain,
'customer_id' => $this->customer_id
]);
}),
];
}
}