From b0076d4a9591f96b4337e1d5cb857a5876270427 Mon Sep 17 00:00:00 2001 From: "Pedro X." Date: Fri, 1 Mar 2024 11:39:34 +0000 Subject: [PATCH 1/2] reorder form trait parameters --- .../Http/Controllers/Operations/Concerns/HasForm.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/Http/Controllers/Operations/Concerns/HasForm.php b/src/app/Http/Controllers/Operations/Concerns/HasForm.php index 1e38e83dba..1eca2ab13f 100644 --- a/src/app/Http/Controllers/Operations/Concerns/HasForm.php +++ b/src/app/Http/Controllers/Operations/Concerns/HasForm.php @@ -18,13 +18,13 @@ protected function formRoutes(string $operationName, bool $routesHaveIdSegment, $postFormMethod = 'post'.$operationName.'Form'; Route::get($segment.$secondSegment.$thirdSegment, [ - 'as' => $routeName.'.'.$getFormMethod, - 'uses' => $controller.'@'.$getFormMethod, + 'as' => $routeName.'.'.$getFormMethod, + 'uses' => $controller.'@'.$getFormMethod, 'operation' => $operationName, ]); Route::post($segment.$secondSegment.$thirdSegment, [ - 'as' => $routeName.'.'.$postFormMethod, - 'uses' => $controller.'@'.$postFormMethod, + 'as' => $routeName.'.'.$postFormMethod, + 'uses' => $controller.'@'.$postFormMethod, 'operation' => $operationName, ]); } @@ -50,7 +50,7 @@ protected function formDefaults(string $operationName, string $buttonStack = 'li // add a reasonable "save and back" save action $this->crud->addSaveAction([ - 'name' => 'save_and_back', + 'name' => 'save_and_back', 'visible' => function ($crud) use ($operationName) { return $crud->hasAccess($operationName); }, @@ -101,7 +101,7 @@ public function formView(?int $id = null): \Illuminate\Contracts\View\View * * @return array|\Illuminate\Http\RedirectResponse */ - public function formAction(?int $id = null, callable $formLogic) + public function formAction(callable $formLogic, ?int $id = null) { if ($id) { // Get entry ID from Request (makes sure its the last ID for nested resources) From b311593b30846dd7a7bb09c980ac7f3a62da9712 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Fri, 1 Mar 2024 11:39:48 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI [ci skip] [skip ci] --- .../Http/Controllers/Operations/Concerns/HasForm.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/Http/Controllers/Operations/Concerns/HasForm.php b/src/app/Http/Controllers/Operations/Concerns/HasForm.php index 1eca2ab13f..818469ca68 100644 --- a/src/app/Http/Controllers/Operations/Concerns/HasForm.php +++ b/src/app/Http/Controllers/Operations/Concerns/HasForm.php @@ -18,13 +18,13 @@ protected function formRoutes(string $operationName, bool $routesHaveIdSegment, $postFormMethod = 'post'.$operationName.'Form'; Route::get($segment.$secondSegment.$thirdSegment, [ - 'as' => $routeName.'.'.$getFormMethod, - 'uses' => $controller.'@'.$getFormMethod, + 'as' => $routeName.'.'.$getFormMethod, + 'uses' => $controller.'@'.$getFormMethod, 'operation' => $operationName, ]); Route::post($segment.$secondSegment.$thirdSegment, [ - 'as' => $routeName.'.'.$postFormMethod, - 'uses' => $controller.'@'.$postFormMethod, + 'as' => $routeName.'.'.$postFormMethod, + 'uses' => $controller.'@'.$postFormMethod, 'operation' => $operationName, ]); } @@ -50,7 +50,7 @@ protected function formDefaults(string $operationName, string $buttonStack = 'li // add a reasonable "save and back" save action $this->crud->addSaveAction([ - 'name' => 'save_and_back', + 'name' => 'save_and_back', 'visible' => function ($crud) use ($operationName) { return $crud->hasAccess($operationName); },