How to edit SlideOver

Hi can you help i want to swap the buttons in the slideOver like i would do if i have the form(show down) is this possible. I also want to edit the heading the when i click the edit.

protected function getFormActions(): array
{
return array_reverse(parent::getFormActions());
}

protected function getFormActions(): array
{
return array_reverse(parent::getFormActions());
}
Solution:
Find the problem for the heading this is the solution
Jump to solution
10 Replies
Solution
mile4841
mile48414mo ago
Find the problem for the heading this is the solution
mile4841
mile4841OP4mo ago
Tables\Actions\EditAction::make()
->slideOver()
->modalHeading(function($record){
return "Edit " . $record->something;
}),
Tables\Actions\EditAction::make()
->slideOver()
->modalHeading(function($record){
return "Edit " . $record->something;
}),
Dennis Koch
Dennis Koch4mo ago
You should be able to overwrite the actions via ->modalFooterActions()
mile4841
mile4841OP4mo ago
I should add modalFooterActions on what
Dennis Koch
Dennis Koch4mo ago
In the action that you want to change the modal actions for.
mile4841
mile4841OP4mo ago
I do not understand where i am able to modify order of mine buttons this is mine code now i want to reorder buttons
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->slideOver()
->modalFooterActions(),
];
}
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->slideOver()
->modalFooterActions(),
];
}
Dennis Koch
Dennis Koch4mo ago
You need to specify the actions for the footer. Check the source code for the Create action to see how they are defined in the first place, then do the same in your order. Can’t give you more hints only on mobile.
mile4841
mile4841OP4mo ago
still nothing i still have the same case
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->slideOver()
->modalFooterActions([
CreateAction::make(''),
]),
];
}
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->slideOver()
->modalFooterActions([
CreateAction::make(''),
]),
];
}
awcodes
awcodes4mo ago
->modalFooterActions(function (Action $action) {
return [
$action->getModalCancelAction(),
$action->getModalSubmitAction(),
...other actions,
];
})
->modalFooterActions(function (Action $action) {
return [
$action->getModalCancelAction(),
$action->getModalSubmitAction(),
...other actions,
];
})
mile4841
mile4841OP4mo ago
Thanks bro it worked Is somehow possible here to swap the buttons
Select::make('tag_id')
->required()
->preload(true)
->relationship('tags', 'title')
->label('Tags')
->searchable()
->multiple()
->createOptionForm([
TextInput::make('title')
->unique()
->required()
->maxLength(255)

])->createOptionAction(function(Action $action){
$action->mutateFormDataUsing(function(array $data){
$data['slug'] = $data['title'];
return $data;
});
}),
Select::make('tag_id')
->required()
->preload(true)
->relationship('tags', 'title')
->label('Tags')
->searchable()
->multiple()
->createOptionForm([
TextInput::make('title')
->unique()
->required()
->maxLength(255)

])->createOptionAction(function(Action $action){
$action->mutateFormDataUsing(function(array $data){
$data['slug'] = $data['title'];
return $data;
});
}),
Want results from more Discord servers?
Add your server