Open a new tab

Is it possible to open this url in a new tab?
Action::make('paid_deposit_amount')
->label(__('quote-resource.action.paid_deposit_amount'))
->requiresConfirmation()
->action(function ($record) {
$url = Quote::createStripeSession($record, $record->artist);
return redirect($url);
})
->hidden(function ($record) {
return (bool)$record->invoice;
}),
Action::make('paid_deposit_amount')
->label(__('quote-resource.action.paid_deposit_amount'))
->requiresConfirmation()
->action(function ($record) {
$url = Quote::createStripeSession($record, $record->artist);
return redirect($url);
})
->hidden(function ($record) {
return (bool)$record->invoice;
}),
Solution:
okay thank you
Jump to solution
8 Replies
Dennis Koch
Dennis Koch14mo ago
Not if it’s an action. But you can use url()
Becker Maxime
Becker MaximeOP14mo ago
how ?
krekas
krekas14mo ago
url() he said it
Becker Maxime
Becker MaximeOP14mo ago
I can't extract it from the ? action and use openUrlInNewTab().
Dennis Koch
Dennis Koch14mo ago
No, because it's a redirect and Livewire doesn't handle redirects to new windows. The other one is a link
Solution
Becker Maxime
Becker Maxime14mo ago
okay thank you
Becker Maxime
Becker MaximeOP14mo ago
Action::make('paid_deposit_amount')
->label(__('quote-resource.action.paid_deposit_amount'))
->requiresConfirmation()
->url(fn($record): string => Quote::createStripeSession($record, $record->artist))
->openUrlInNewTab()
->hidden(function ($record) {
return (bool)$record->invoice;
}),
Action::make('paid_deposit_amount')
->label(__('quote-resource.action.paid_deposit_amount'))
->requiresConfirmation()
->url(fn($record): string => Quote::createStripeSession($record, $record->artist))
->openUrlInNewTab()
->hidden(function ($record) {
return (bool)$record->invoice;
}),
I use this technique and you're right it works correction thank you
Want results from more Discord servers?
Add your server