Skip to content

Commit

Permalink
config routes must be hard-coded
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed Dec 29, 2020
1 parent 7cccfe6 commit 1adc0ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@

class ConfigController extends Controller
{
public function edit(string $handle)
public function edit(Request $request)
{
$handle = $request->segment(2);

$blueprint = $this->getBlueprint($handle);

$fields = $blueprint
Expand All @@ -29,8 +31,10 @@ public function edit(string $handle)
]);
}

public function update(string $handle, Request $request)
public function update(Request $request)
{
$handle = $request->segment(2);

$blueprint = $this->getBlueprint($handle);

// Get a Fields object, and populate it with the submitted values.
Expand Down
2 changes: 1 addition & 1 deletion src/FormaAddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private function registerRoutes()
}

Statamic::pushCpRoutes(function () {
Route::name($this->addon->handle())->prefix('{handle}')->group(function () {
Route::name($this->addon->handle())->prefix($this->addon->handle())->group(function () {
Route::name('.config.')->prefix('config')->group(function () {
Route::get('edit', [$this->controller, 'edit'])->name('edit');
Route::post('update', [$this->controller, 'update'])->name('update');
Expand Down

0 comments on commit 1adc0ab

Please sign in to comment.