© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
11 replies
leoblanski

Creating custom livewire action Componente using relationships

Hey guys.

I'm trying to create a Livewire component that will return an Action where I'm using
->fillForm(function ()
->fillForm(function ()
to fill a multi-select with tag options.

It works perfectly when I'm using this action directly on my resource, using headerFunction from View page, but using a custom livewire component doesn't work. Taking a look I imagine that is something related with relationships.

Blade:
 <livewire:manage-tag-action :model="$client"/>
 <livewire:manage-tag-action :model="$client"/>


Component:

class ManageTagAction extends Component implements HasForms, HasActions
{
    use InteractsWithForms;
    use InteractsWithActions;

    public Tag   $tag;
    public Model $model;

    public function mount(Tag $tag, Model $model)
    {
        $this->tag   = $tag;
        $this->model = $model;
    }
class ManageTagAction extends Component implements HasForms, HasActions
{
    use InteractsWithForms;
    use InteractsWithActions;

    public Tag   $tag;
    public Model $model;

    public function mount(Tag $tag, Model $model)
    {
        $this->tag   = $tag;
        $this->model = $model;
    }
Solution
You need to provide your model to the action. Probably

->record(fn ($livewire) => $livewire->model)
->record(fn ($livewire) => $livewire->model)
or similar
Jump to solution
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

Saving relationships on livewire Action
FilamentFFilament / ❓┊help
2y ago
Custom action triggers /livewire/update
FilamentFFilament / ❓┊help
2y ago
Problem creating Custom Field rendering Livewire
FilamentFFilament / ❓┊help
15mo ago
livewire action
FilamentFFilament / ❓┊help
2y ago