//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'),
]),
]);
}
}//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'),
]),
]);
}
}