Custom Modal Action is making a post to 'update' instead of running method.
Actions::make([
Action::make('Save')->action(function(){
$this->save();
})->disabled(function(){
return !$this->test_complete;
}),
Action::make('Test Connection')->action(function(){
$this->connect();
})
Actions::make([
Action::make('Save')->action(function(){
$this->save();
})->disabled(function(){
return !$this->test_complete;
}),
Action::make('Test Connection')->action(function(){
$this->connect();
})
->actions([
Tables\Actions\Action::make('Edit')
->fillForm(function(Connection $record) {
$this->data = $record->toArray();
return [
'name' => $record->name,
'domain' =>$record->domain,
//'token' => $record->token,
'email' => $record->email,
];
})
->form([$this->getProfileSection()])
->modalSubmitAction(false)
->actions([
Tables\Actions\Action::make('Edit')
->fillForm(function(Connection $record) {
$this->data = $record->toArray();
return [
'name' => $record->name,
'domain' =>$record->domain,
//'token' => $record->token,
'email' => $record->email,
];
})
->form([$this->getProfileSection()])
->modalSubmitAction(false)
1 Reply
I suspect it's because your calling $this in the action. Try:
self::connect();