// Component
class MyPage extends Component implements HasForms, HasActions
{
use InteractsWithForms;
use InteractsWithActions;
public function editAction(): Action
{
return Action::make('edit')
->mountUsing(function (Action $action, array $arguments): void {
// Resolve
$record = Author::find($arguments['id']);
// I'm guessing this, this will not work.
$action->record($record);
})
->form([
TextInput::make('title'),
Repeater::make('books')->relationship('books') // Repeater must know $record in order to work
])
->action(function (array $data, Model $record) {
$record->update($data);
})
}
}
// Component
class MyPage extends Component implements HasForms, HasActions
{
use InteractsWithForms;
use InteractsWithActions;
public function editAction(): Action
{
return Action::make('edit')
->mountUsing(function (Action $action, array $arguments): void {
// Resolve
$record = Author::find($arguments['id']);
// I'm guessing this, this will not work.
$action->record($record);
})
->form([
TextInput::make('title'),
Repeater::make('books')->relationship('books') // Repeater must know $record in order to work
])
->action(function (array $data, Model $record) {
$record->update($data);
})
}
}