_𝕰𝖋x
_𝕰𝖋x
FFilament
Created by _𝕰𝖋x on 8/7/2024 in #β“β”Šhelp
Customizing update process globally
Hi, I have a CustomerResource. In my EditCustomer class I added handleRecordUpdate function. In another resource I use a Select field to select a customer. In the field I added an editOptionForm. Unfortunately when I update the customer via the edit modal my handleRecordUpdate function is not being executed. I saw there is a updateOptionUsing function for the select field but I do not want to copy the same code from handleRecordUpdate because whenever I change something there I have to update the code in updateOptionUsing as well. Is there a way to have one single update handle function globally which is being executed no matter whether the record is being updated via edit page or actions or relations? I could not find any information in the docs.
5 replies
FFilament
Created by _𝕰𝖋x on 3/2/2024 in #β“β”Šhelp
createOptionForm Rendering-Error
No description
2 replies
FFilament
Created by _𝕰𝖋x on 2/26/2024 in #β“β”Šhelp
Function to submit form
I would like to submit the form after the user updates a select field. I tried it with live() but after updating the select field and reloading the page (without pressing save button) it is not being updated in the database
6 replies
FFilament
Created by _𝕰𝖋x on 2/26/2024 in #β“β”Šhelp
Not Loading Data from Fieldset->relationship()
I have a Fieldset with hasOne relationship() and my form schema(), like here:
Select::make('metadata_id')
->relationship(name: 'metadata', titleAttribute: 'title')

Fieldset::make('Metadata')
->relationship('metadata')
->schema([
TextInput::make('title'),
Textarea::make('description'),
FileUpload::make('image'),
])->disabled()
Select::make('metadata_id')
->relationship(name: 'metadata', titleAttribute: 'title')

Fieldset::make('Metadata')
->relationship('metadata')
->schema([
TextInput::make('title'),
Textarea::make('description'),
FileUpload::make('image'),
])->disabled()
The form has ->disabled() because I only want it to show the data. I selected the correct one in the Select-field and saved the form. But after reloading the page it does not load the data.
8 replies
FFilament
Created by _𝕰𝖋x on 1/10/2024 in #β“β”Šhelp
Exclude TextInput in Form from saving in database
Hi! I have following Text input:
TextInput::make('checkServicePIN')
->label('Service-PIN')->password()->autocomplete(false)->columns(1)
->suffixAction(
Action::make('checkServicePIN')
->icon('heroicon-m-check-circle')
->action(function (?Model $record, $state, Set $set) {
$state == $record->service_pin ? $record->lastPINentry = true : $record->lastPINentry = false;
$record->save();
})
),
Placeholder::make('lastPINentry')
->content(fn (Order $record): string => $record->lastPINentry == 1 ? new HtmlString('right') : new HtmlString('wrong')),
TextInput::make('checkServicePIN')
->label('Service-PIN')->password()->autocomplete(false)->columns(1)
->suffixAction(
Action::make('checkServicePIN')
->icon('heroicon-m-check-circle')
->action(function (?Model $record, $state, Set $set) {
$state == $record->service_pin ? $record->lastPINentry = true : $record->lastPINentry = false;
$record->save();
})
),
Placeholder::make('lastPINentry')
->content(fn (Order $record): string => $record->lastPINentry == 1 ? new HtmlString('right') : new HtmlString('wrong')),
So basically if I enter the pin, it tells me whether it is correct or not. This functionality is working. But below this I have my regular Form. And as soon as I want to save the Form it tells me that the column checkServicePIN does not exist. This is right but I do not want to save the entered pin. It should only check it with the one that is already stored in the database and save the result in the column lastPINentry. The Placeholder shows this result. How can I exclude the text input from beeing saved to the databse?
5 replies