Filament Forms & Actions: How to open to external URL with new browser tab after a form has been filled
Once the form been filled and the user click to submit action I want to open an external URL with new browser tab.
Code Snippet:
<?php
namespace App\Filament\App\Pages;
...
class Search extends Page
{
use InteractsWithFormActions;
public ?array $data = [];
public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')
->placeholder(__('e.g. Oliver Queen'))
->autofocus(),
])
->statePath('data');
}
public function submit(): void
{
$data = $this->form->getState();
}
public function getSubmitFormAction(): Action
{
return Action::make('submit')
->label(__('Submit'))
->color('primary')
->action('submit');
}
}