Action::make('top')
->form([
Forms\Components\Select::make('type')
->label('Top')
->options([
'small' => getPostDetail('small')->price . '€' . ' ' . getPostDetail('small')->name . ' (' . getPostDetail('small')->duration . ' days)',
'topped' => getPostDetail('topped')->price . '€' . ' ' . getPostDetail('topped')->name . ' (' . getPostDetail('topped')->duration . ' days)',
'popup' => getPostDetail('popup')->price . '€' . ' ' . getPostDetail('popup')->name . ' (' . getPostDetail('popup')->duration . ' days)'
])
->required()
])
->action(function (array $data, Post $post) {
$payment = new Payment();
$payment->post()->associate($post);
$payment->user()->associate(auth()->user());
$payment->type = $data['type'];
$payment->price = getPostDetail($data['type'])->price;
$payment->save();
$payment->user->notify(new PaymentCreated($payment));
Notification::make()
->title('You have created a new payment.')
->icon('heroicon-o-check-circle')
->iconColor('success')
->send();
// Redirect here and open infolist?
}),)