How to store extra data in custom field except state?

Hi, I am conducting some experiments with Filament. I have extended the SpatieMediaLibraryFileUpload class and added an action that opens a modal containing a form. When the user saves the form, I want to save the data in the background. I added a property and a setter like this:
public array $formCustomProperties = [];

public function setFormCustomProperties(array $properties): self
{
$this->formCustomProperties = $properties;

return $this;
}
public array $formCustomProperties = [];

public function setFormCustomProperties(array $properties): self
{
$this->formCustomProperties = $properties;

return $this;
}
Here is the logic for the action (currently not working):
->action(function (array $arguments, SpatieMediaLibraryFileUpload $component, $data): void {
$formCustomProperties = $component->formCustomProperties;
$formCustomProperties[$arguments['key']] = $data;
$component->setFormCustomProperties($formCustomProperties);
})
->action(function (array $arguments, SpatieMediaLibraryFileUpload $component, $data): void {
$formCustomProperties = $component->formCustomProperties;
$formCustomProperties[$arguments['key']] = $data;
$component->setFormCustomProperties($formCustomProperties);
})
With this implementation, I can set the custom properties within the same session, but they are not preserved in next sessions. I need to store the custom properties similarly to how Livewire properties are stored. Thank you for your assistance.
No description
1 Reply
Biostate
BiostateOP6mo ago
So nobody knows the way? I want to add custom properties like Laravel Nova plugin and add to filament with a PR. Pleaseeee.
Want results from more Discord servers?
Add your server