SinthuMS
SinthuMS
FFilament
Created by SinthuMS on 1/9/2024 in #❓┊help
Notification before return
When i click a button,downloading notification should appear
public function product()
{
$this->validate();

Notification::make()
->title('Downloading')
->body('Downloading Product Report')
->success()
->send();
public function product()
{
$this->validate();

Notification::make()
->title('Downloading')
->body('Downloading Product Report')
->success()
->send();
after downloaded notification should appear
Notification::make()
->success()
->title('Download Complete')
->body('Product Report Downloaded')
->send()
Notification::make()
->success()
->title('Download Complete')
->body('Product Report Downloaded')
->send()
but both these notifications are sent after the function return. Is there any way to show the notification before return
1 replies
FFilament
Created by SinthuMS on 1/1/2024 in #❓┊help
Modify the state of a select box in repeater when an item is added
When i add items to my repeater my select box should have option that is previously selected,i used this but i can see the other options too
->addAction(fn ($action) => $action->after(function (Forms\Components\Repeater $component) {
$component->state(function ($state) {
$answers = collect($state);
$type=$answers->pluck('select_product')->first();
$newAnswerKey = $answers->keys()->last();
$answers[$newAnswerKey] = ['select_product' => $type,];
return $answers->toArray();
})
}))
->addAction(fn ($action) => $action->after(function (Forms\Components\Repeater $component) {
$component->state(function ($state) {
$answers = collect($state);
$type=$answers->pluck('select_product')->first();
$newAnswerKey = $answers->keys()->last();
$answers[$newAnswerKey] = ['select_product' => $type,];
return $answers->toArray();
})
}))
How can change the options here..please help
2 replies