Helge Sverre
Helge Sverre
FFilament
Created by Helge Sverre on 4/17/2024 in #❓┊help
How to set the "primary" table action?
No description
7 replies
FFilament
Created by Helge Sverre on 1/2/2024 in #❓┊help
Max height on FileUpload or modal?
No description
3 replies
FFilament
Created by Helge Sverre on 12/22/2023 in #❓┊help
Prefilling a Field in "Create New Option" Modal of a Select Component in FilamentPHP**
I want to prefill a field in the "create new option" modal, Here's the code I've tried, but it doesn't seem to be effective:
<?php

use App\Filament\Actions\CreateProductInPaddle;
use App\Filament\Resources\ProductResource;
use Filament\Forms\Components\Select;
use Filament\Forms\Form;

Select::make('product_id')
->relationship('product', 'title')
->placeholder('No products available')
->searchable()
->createOptionForm(function (Form $form) {
$form->fill(["title" => "prefilled"]);
return ProductResource::form($form);
})
->createOptionUsing(fn($data, CreateProductInPaddle $action) => $action($data))
->allowHtml()
->required(),
<?php

use App\Filament\Actions\CreateProductInPaddle;
use App\Filament\Resources\ProductResource;
use Filament\Forms\Components\Select;
use Filament\Forms\Form;

Select::make('product_id')
->relationship('product', 'title')
->placeholder('No products available')
->searchable()
->createOptionForm(function (Form $form) {
$form->fill(["title" => "prefilled"]);
return ProductResource::form($form);
})
->createOptionUsing(fn($data, CreateProductInPaddle $action) => $action($data))
->allowHtml()
->required(),
Is there a proper way to prefill data in this scenario with Filament, or is this not supported yet? Any suggestions or code examples would be greatly appreciated.
5 replies
FFilament
Created by Helge Sverre on 10/20/2023 in #❓┊help
Tenancy - but not tenancy?
No description
9 replies