QCTFW
QCTFW
FFilament
Created by QCTFW on 7/6/2024 in #❓┊help
Disable Default Sort while Searching with Scout
up still not find the answer
4 replies
FFilament
Created by QCTFW on 7/5/2024 in #❓┊help
Can I define an extra searchable column without creating a column in the table?
How did I missed that? 🤦‍♂️ Thank you, @Vp @yebor974. It works!
6 replies
FFilament
Created by QCTFW on 9/13/2023 in #❓┊help
Confirmation Alert Before Creating a Record
Solved Code
protected function getCreateFormAction(): Action
{
return Action::make('create')
->icon('heroicon-s-shopping-cart')
->label('Create an Order')
->action(fn (CreateOrder $livewire) => $livewire->create())
->requiresConfirmation()
->modalHeading('Confirm the Order')
->modalDescription('Do you confirm that the order is correct?')
->modalSubmitActionLabel('Confirm')
->keyBindings(['mod+s']);
}
protected function getCreateFormAction(): Action
{
return Action::make('create')
->icon('heroicon-s-shopping-cart')
->label('Create an Order')
->action(fn (CreateOrder $livewire) => $livewire->create())
->requiresConfirmation()
->modalHeading('Confirm the Order')
->modalDescription('Do you confirm that the order is correct?')
->modalSubmitActionLabel('Confirm')
->keyBindings(['mod+s']);
}
12 replies
FFilament
Created by QCTFW on 9/13/2023 in #❓┊help
Confirmation Alert Before Creating a Record
Okay, I changed the code to $livewire->create() and now the code is working. Thank you so much for helping me.
12 replies
FFilament
Created by QCTFW on 9/13/2023 in #❓┊help
Confirmation Alert Before Creating a Record
No description
12 replies
FFilament
Created by QCTFW on 9/14/2023 in #❓┊help
How to Open Another Modal from Action Modal?
Unfortunately, the modal still does not appear.
Actions\Action::make('import')
->icon('heroicon-m-arrow-up-tray')
->label('Import')
->color('info')
->form([
Forms\Components\FileUpload::make('file')
->label('Excel file')
// ->...
->required()
])
->action(function ($data, $livewire) {
// Do the import thing

// Close this modal and open another modal for displaying the import result
$livewire->dispatch('open-modal', id: 'result');
$livewire->dispatch('open-modal', id: 'result-action'); // Also tried this, the result modal does not appear either
})
Actions\Action::make('import')
->icon('heroicon-m-arrow-up-tray')
->label('Import')
->color('info')
->form([
Forms\Components\FileUpload::make('file')
->label('Excel file')
// ->...
->required()
])
->action(function ($data, $livewire) {
// Do the import thing

// Close this modal and open another modal for displaying the import result
$livewire->dispatch('open-modal', id: 'result');
$livewire->dispatch('open-modal', id: 'result-action'); // Also tried this, the result modal does not appear either
})
Here is the import action code.
Actions\Action::make('result')
->modalContent(new HtmlString('<div>Hello</div>')); // Test string
Actions\Action::make('result')
->modalContent(new HtmlString('<div>Hello</div>')); // Test string
7 replies
FFilament
Created by QCTFW on 9/14/2023 in #❓┊help
How to Open Another Modal from Action Modal?
How to know the modal ID? Do I have to create another action for the result modal to get the modal ID?
7 replies
FFilament
Created by QCTFW on 9/13/2023 in #❓┊help
Confirmation Alert Before Creating a Record
This is my current code. I used the parent CreateRecord class as a reference.
protected function getCreateFormAction(): Action
{
return Action::make('create')
->icon('heroicon-s-shopping-cart')
->label('Create an Order')
->submit('create')
->requiresConfirmation()
->modalHeading('Confirm the Order')
->modalDescription('Do you confirm that the order is correct?')
->modalSubmitActionLabel('Confirm')
->keyBindings(['mod+s']);
}
protected function getCreateFormAction(): Action
{
return Action::make('create')
->icon('heroicon-s-shopping-cart')
->label('Create an Order')
->submit('create')
->requiresConfirmation()
->modalHeading('Confirm the Order')
->modalDescription('Do you confirm that the order is correct?')
->modalSubmitActionLabel('Confirm')
->keyBindings(['mod+s']);
}
12 replies
FFilament
Created by QCTFW on 9/13/2023 in #❓┊help
Confirmation Alert Before Creating a Record
I've already tried this. In v3, getSaveFormAction() does not exists so I change the method to getCreateFormAction() and change Action::make('save') to Action::make('create') but the confirmation alert still does not pop up.
12 replies
FFilament
Created by QCTFW on 9/12/2023 in #❓┊help
Access Relationship Input in mutateFormDataBeforeCreate()
Sorry for the late response. $this->data does return all the request data. Thank you so much.
6 replies