benzo
benzo
FFilament
Created by benzo on 10/10/2023 in #❓┊help
Wizard modal with custom modal content
I am passing data to a custom modal content which is a wizard. Custom data is showing when the modal opens, but when clicking on the button to go to the next step, I am loosing the custom data passed to the custom view. The goal is to perform a custom modal action based on the custom data. This action may be performed at every steps, not sure what am I missing. Ideas?
//sandbox.blade.php
<div>
@foreach ($participants as $participant)
<div>
{{ $participant->name }} - {{ $participant->email }}
</div>
{{ ($this->edit)(['participant' => $participant->id]) }}
@endforeach
<x-filament-actions::modals />
</div>
//sandbox.blade.php
<div>
@foreach ($participants as $participant)
<div>
{{ $participant->name }} - {{ $participant->email }}
</div>
{{ ($this->edit)(['participant' => $participant->id]) }}
@endforeach
<x-filament-actions::modals />
</div>
//advance.blade.php
<div>
$arguments : @json($arguments)
{{ $action->getModalAction('report') }}
</div>
//advance.blade.php
<div>
$arguments : @json($arguments)
{{ $action->getModalAction('report') }}
</div>
//Sandbox.php
class Sandbox extends Component implements HasActions, HasForms
{
use InteractsWithActions, InteractsWithForms;

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

->fillForm(function (array $arguments) {
return Participant::find($arguments['participant'])->toArray();
})
->registerModalActions([
Action::make('report')
->action(fn (array $arguments) => Log::info('report', $arguments)),
])
->action(fn (array $arguments) => Log::info('action', $arguments)
)
->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 function editAction()
{
return Action::make('edit')

->fillForm(function (array $arguments) {
return Participant::find($arguments['participant'])->toArray();
})
->registerModalActions([
Action::make('report')
->action(fn (array $arguments) => Log::info('report', $arguments)),
])
->action(fn (array $arguments) => Log::info('action', $arguments)
)
->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/5/2023 in #❓┊help
Modal alignment
Can someone try the modal alignment? It always seems to be centered... Thanks! <x-filament::modal alignment="start"> https://filamentphp.com/docs/3.x/support/blade-components/modal#changing-the-modals-alignment
4 replies
FFilament
Created by benzo on 7/25/2023 in #❓┊help
Dashboard with filters
What would be the best filament way to build an analytic/sales dashboard with a global date range filter? The dashboard is mainly based on one table records, so resource page I guess? Is there a way to reuse the table filter with date-range filament plugin? Or a custom select input form using query params? Something like: https://www.belikesoftware.com/wp-content/uploads/2017/02/dashboard-prestashop.png
7 replies