benzo
benzo
FFilament
Created by Alex Manase on 6/12/2024 in #❓┊help
How to test `headerActions`/`footerActions` from the Section component?
callTableAction is a start to ensure the action is present on the page. But regarding the Importer class, I have no clue except from testing each method of this class individually. Have you found something?
6 replies
FFilament
Created by StanProg on 8/25/2023 in #❓┊help
BulkAction with polling within action closure
This is what I use but if you found another way to deal with it I will be happy to hear it!
4 replies
FFilament
Created by StanProg on 8/25/2023 in #❓┊help
BulkAction with polling within action closure
hey @StanProg have you found a solution? You might add the ->extraAttributes() method to your action with a callback returning conditionally ['wire:poll' => '']
4 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
put your Draft button wherever you want with :
wire:click="$set('draft', true)"
wire:click="$set('draft', true)"
Then check the draft value into your submit logic
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
->submitAction(
new HtmlString(
Blade::render(<<<'BLADE'
<x-filament::button
type="submit"
wire:click="$set('draft', false)"
>
Submit
</x-filament::button>
BLADE
)
)
)
->submitAction(
new HtmlString(
Blade::render(<<<'BLADE'
<x-filament::button
type="submit"
wire:click="$set('draft', false)"
>
Submit
</x-filament::button>
BLADE
)
)
)
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
Hey @shojibflamon, I have a boolean $draft property at the LW component level. Then my custom modal content has a "Save as draft" button firing the submit form action. This button contains a specific directive ( wire:click="$set('draft', true)" ) that allows me to have form validation and knowing in the same time if the submit action is a draft or not. This is my use case but it depends what you would like to achieve.
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
Hey @Patrick Boivin , I ended up by making a form with a wizard inside as you cleverly advised. With this solution where I can have a better control on form data. I guess using steps is quick for basic wizard forms. Thanks for your guidances, learned a lot here!
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
Complex indeed! Good idea, I will try with a form, I'll keep you updated 👍
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
Ok, If I add ->modalSubmitAction(false), it removes the submit button on the final step. I can not add a submitAction(),this method is not available as this is not a Wizard object but an Action Modal with Steps. I could add another modal action 'submit the form' but I am not sure if I can retreive the "latest" step of the wizard to only display it on this condition. I am not sure to follow what you me to do!
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
Sure! when clicking on the next button on the modal wizard, form validation happens. But when clicking on the modalAction button, there is no validation. My modalAction needs the form data (adn validation ) to be performed. That's why I tried to pass the Form object into the callback but the object is null. For now I retrieve the form data from the LW component but without validation. Not sure if I can access the form object from the LW object
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
OK, making progress here, but facing a new wall
->registerModalActions([
Action::make('report')
->action(fn (Form $form) => $this->participant->saveAsDraft($form)), // ($form) must be of type Filament\Forms\Form, null given.
])
->registerModalActions([
Action::make('report')
->action(fn (Form $form) => $this->participant->saveAsDraft($form)), // ($form) must be of type Filament\Forms\Form, null given.
])
The $form is not available at this level, I partially solved it by using the LW component which is accessible, [not ideal as I cannot fire validation] but I just want to know if it is the good way to do it
->registerModalActions([
Action::make('report')
->action(fn (Component $livewire) => $this->participant->saveAsDraft($livewire->mountedActionsData[0])), // handling the array data.
])
->registerModalActions([
Action::make('report')
->action(fn (Component $livewire) => $this->participant->saveAsDraft($livewire->mountedActionsData[0])), // handling the array data.
])
Maybe there is another way to make another button where the form data could be accessible. Ideas?
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
Hey @Patrick Boivin thanks for the hint, sometimes I just forgot I am inside a LW component! This is what I ended up with:
//Sandbox.php
class Sandbox extends Component implements HasActions, HasForms
{
use InteractsWithActions, InteractsWithForms;

public Participant $participant;

public function editAction()
{
return Action::make('edit')

->mountUsing(function (array $arguments, Form $form) {
$this->participant = Participant::find($arguments['id']);
$form->fill($this->participant->toArray());
})

->registerModalActions([
Action::make('report')
->action(fn () => Log::info('report', $this->participant)),
])
->action(fn () => Log::info('action', $this->participant)
)
->modalContent(fn (array $arguments, Action $action): View => view(
'filament.pages.actions.advance',
['arguments' => $arguments, 'action' => $action]
))
->steps([
Step::make('Name')
->schema([
TextInput::make('name'),
]),
Step::make('Email')
->schema([
TextInput::make('email'),
]),
]);
}
}
//Sandbox.php
class Sandbox extends Component implements HasActions, HasForms
{
use InteractsWithActions, InteractsWithForms;

public Participant $participant;

public function editAction()
{
return Action::make('edit')

->mountUsing(function (array $arguments, Form $form) {
$this->participant = Participant::find($arguments['id']);
$form->fill($this->participant->toArray());
})

->registerModalActions([
Action::make('report')
->action(fn () => Log::info('report', $this->participant)),
])
->action(fn () => Log::info('action', $this->participant)
)
->modalContent(fn (array $arguments, Action $action): View => view(
'filament.pages.actions.advance',
['arguments' => $arguments, 'action' => $action]
))
->steps([
Step::make('Name')
->schema([
TextInput::make('name'),
]),
Step::make('Email')
->schema([
TextInput::make('email'),
]),
]);
}
}
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
23 replies
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
$arguments : @json($arguments) //shows the participant ID when modal opens then becomes empty when going to wizard's next step
$arguments : @json($arguments) //shows the participant ID when modal opens then becomes empty when going to wizard's next step
23 replies
FFilament
Created by benzo on 10/5/2023 in #❓┊help
Modal alignment
Found why, div content had a center class overriding the modal behaviour... 👍
4 replies
FFilament
Created by benzo on 7/25/2023 in #❓┊help
Dashboard with filters
Ok, so not even a resource page, basic custom page with widgets 👍🏼 Yeah a bit old, I took the first example I had in mind corresponding to what I would like to build, different data but concept is basically the same!
7 replies
FFilament
Created by vahnmarty on 7/6/2023 in #❓┊help
$this->form->getState() without firing validations?
->required(true && !this->draft) This works perfectly, solution was right in front of me! Thanks @pboivin
11 replies
FFilament
Created by vahnmarty on 7/6/2023 in #❓┊help
$this->form->getState() without firing validations?
Ah nice! I will have to work with an intermediate status or updateQuietly the model as the published status could fired an event. This will also remove the red (*) mandatory label indicator on draft status but I'll give it a try!
11 replies
FFilament
Created by Pablo Torres on 7/24/2023 in #❓┊help
Price - show as money but store in cents
mutator is fine but this is more filament way
6 replies
FFilament
Created by Pablo Torres on 7/24/2023 in #❓┊help
Price - show as money but store in cents
6 replies