© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
Biostate

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.
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

load and store state in custom field
FilamentFFilament / ❓┊help
2y ago
how to update state in custom field?
FilamentFFilament / ❓┊help
14mo ago
Send extra field from custom field.
FilamentFFilament / ❓┊help
2y ago
Custom Data in a table - how to set empty state?
FilamentFFilament / ❓┊help
5mo ago