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