Skip to content

Commit

Permalink
Fix legacy settings in Twill 3
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceverheije authored Feb 2, 2024
1 parent 1f443d8 commit 23b6d63
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Http/Controllers/Admin/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,26 @@ public function __construct(
*/
public function index(string $section)
{
return $this->viewFactory->exists('twill.settings.' . $section)
? $this->viewFactory->make('twill.settings.' . $section, [
if (! $this->viewFactory->exists('twill.settings.' . $section)) {
return $this->redirector->back();
}

$formFields = $this->settings->getFormFieldsForSection($section);

View::share('form', [

Check failure on line 70 in src/Http/Controllers/Admin/SettingController.php

View workflow job for this annotation

GitHub Actions / lint

Call to static method share() on an unknown class A17\Twill\Http\Controllers\Admin\View.
'form_fields' => $formFields,
]);

return $this->viewFactory->make('twill.settings.' . $section, [
'customForm' => true,
'editableTitle' => false,
'customTitle' => ucfirst($section) . ' settings',
'section' => $section,
'form_fields' => $this->settings->getFormFieldsForSection($section),
'form_fields' => $formFields,
'formBuilder' => Form::make(),
'saveUrl' => $this->urlGenerator->route(config('twill.admin_route_name_prefix') . 'settings.update', $section),
'translate' => true,
])
: $this->redirector->back();
]);
}

/**
Expand Down

0 comments on commit 23b6d63

Please sign in to comment.