© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
11 replies
haritz

Open url in modal action

Hello,

I am trying to open an url with parameters in a table modal. I want to open a modal, ask the user to write the message and then send it. So far I have the next code but I do not know how to make it work.

->extraModalFooterActions(fn (ActionTable $action): array => [
                        $action->makeModalSubmitAction('send')
                            ->label('Send')
                            ->icon('heroicon-o-paper-airplane')
                            ->color('success'),
                    ])
                    ->action(function (array $data, array $arguments, $record, $action): void {
                        if ($data['message']) {
                            $customer = Customer::find($record->customer_id);
                            $message = $data['message'];
                            $url = 'https://api.whatsapp.com/send?phone=' . $customer->number . '&text=' . urlencode($message);
                            $action->url($url);
                            $action->openUrlInNewTab();
                        }
                    })
->extraModalFooterActions(fn (ActionTable $action): array => [
                        $action->makeModalSubmitAction('send')
                            ->label('Send')
                            ->icon('heroicon-o-paper-airplane')
                            ->color('success'),
                    ])
                    ->action(function (array $data, array $arguments, $record, $action): void {
                        if ($data['message']) {
                            $customer = Customer::find($record->customer_id);
                            $message = $data['message'];
                            $url = 'https://api.whatsapp.com/send?phone=' . $customer->number . '&text=' . urlencode($message);
                            $action->url($url);
                            $action->openUrlInNewTab();
                        }
                    })
Solution
Try this:
    Tables\Actions\Action::make('test')
        ->form([
            TextInput::make('name')->reactive(),
        ])
        ->modalSubmitAction(function ($action, $livewire) {
            $action->url('https://www.example.com/' . ($livewire->mountedTableActionsData[0]['name'] ?? ''));
        }),
    Tables\Actions\Action::make('test')
        ->form([
            TextInput::make('name')->reactive(),
        ])
        ->modalSubmitAction(function ($action, $livewire) {
            $action->url('https://www.example.com/' . ($livewire->mountedTableActionsData[0]['name'] ?? ''));
        }),
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Open action modal
FilamentFFilament / ❓┊help
3y ago
Action open table in modal
FilamentFFilament / ❓┊help
3y ago
Modal Action Hit Url
FilamentFFilament / ❓┊help
3y ago
Open Modal through URL
FilamentFFilament / ❓┊help
3y ago