For the CreateOrder page I want two buttons at the bottom of the form,Draft and New

I need two buttons to create an order. They should set statuses. I try to do it in two ways, but neither works.
public function getFormActions(): array
{
return [
parent::getCreateFormAction()
->label('Draft')
->mutateFormDataUsing(function (array $data): array {
$data['status'] = OrderStatus::Draft;
return $data;
}),
Actions\CreateAction::make('new')
->label('New')
->mutateFormDataUsing(function (array $data): array {
$data['status'] = OrderStatus::New;
return $data;
}),
];
}
public function getFormActions(): array
{
return [
parent::getCreateFormAction()
->label('Draft')
->mutateFormDataUsing(function (array $data): array {
$data['status'] = OrderStatus::Draft;
return $data;
}),
Actions\CreateAction::make('new')
->label('New')
->mutateFormDataUsing(function (array $data): array {
$data['status'] = OrderStatus::New;
return $data;
}),
];
}
Solution:
GitHub
For the Create page resource I want two buttons at the bottom of th...
Package Panel builder Package Version 3.3.0 How can we help you? I need two buttons to create resouce. They should set statuses. I try to do it in two ways, but neither works. public function getFo...
Jump to solution
2 Replies
cepairda
cepairdaOP3mo ago
Very need help guys, thank you
Solution
cepairda
cepairda3mo ago
GitHub
For the Create page resource I want two buttons at the bottom of th...
Package Panel builder Package Version 3.3.0 How can we help you? I need two buttons to create resouce. They should set statuses. I try to do it in two ways, but neither works. public function getFo...

Did you find this page helpful?