© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
1 reply
richusx

Pass data from custom view back to action

Hi!

I have a custom action on a list page that renders a blade view, however, I cannot seem to figure out how to pass data from the modal to the action callback. Any ideas?

The action:
Actions\Action::make('Purchase additional domains')
                ->icon('heroicon-o-currency-dollar')
                ->modalContent(fn () => view('filament.app.components.billing.additional-domains'))
                ->action(function ($data) {
                    dd($data);
                })
                ->outlined()
                ->hidden(fn() => !Auth::user()->isSubscribed())
Actions\Action::make('Purchase additional domains')
                ->icon('heroicon-o-currency-dollar')
                ->modalContent(fn () => view('filament.app.components.billing.additional-domains'))
                ->action(function ($data) {
                    dd($data);
                })
                ->outlined()
                ->hidden(fn() => !Auth::user()->isSubscribed())


Blade view:
<div x-data="{ domainCount: 1, isYearly: false }">
    <p>
        Select the number of additional domains you'd like to purchase. Each additional domain costs &euro;10.00 / <span x-text="isYearly ? 'year' : 'month'"></span>
    </p>
    <div class="mt-8 mb-8">
        <input type="range" min="1" max="10" value="1" class="range" step="1" x-model="domainCount" />
        <div class="flex w-full justify-between px-2 text-xs mt-2">
            <template x-for="i in 10">
                <span x-text="i"></span>
            </template>
        </div>
    </div>

    Your total is &euro;<span x-text="domainCount * (isYearly ? 100 : 10)"></span> / <span x-text="isYearly ? 'year' : 'month'"></span>.
    This will get billed additionally to your existing subscription.
</div>
<div x-data="{ domainCount: 1, isYearly: false }">
    <p>
        Select the number of additional domains you'd like to purchase. Each additional domain costs &euro;10.00 / <span x-text="isYearly ? 'year' : 'month'"></span>
    </p>
    <div class="mt-8 mb-8">
        <input type="range" min="1" max="10" value="1" class="range" step="1" x-model="domainCount" />
        <div class="flex w-full justify-between px-2 text-xs mt-2">
            <template x-for="i in 10">
                <span x-text="i"></span>
            </template>
        </div>
    </div>

    Your total is &euro;<span x-text="domainCount * (isYearly ? 100 : 10)"></span> / <span x-text="isYearly ? 'year' : 'month'"></span>.
    This will get billed additionally to your existing subscription.
</div>
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

How to pass custom data to view from Custom Field?
FilamentFFilament / ❓┊help
3y ago
ActionGroup Action caching custom view
FilamentFFilament / ❓┊help
9mo ago
Pass data to widget from custom page
FilamentFFilament / ❓┊help
2y ago
pass data to widget from custom page
FilamentFFilament / ❓┊help
3y ago