Skip to content

Commit 1857bc5

Browse files
committed
Fix settings to make it inheritable
1 parent cf522d0 commit 1857bc5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ If you want translated content and routes, go through the following steps:
8181
Register the routes in your route file, probably `web.php`:
8282

8383
```php
84-
\Statikbe\FilamentFlexibleContentBlockPages\Facades\FilamentFlexibleContentBlockPages::defineRoutes();
84+
\Statikbe\FilamentFlexibleContentBlockPages\Facades\FilamentFlexibleContentBlockPages::routes();
8585
```
8686

8787
### Filament panel

config/filament-flexible-content-block-pages.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
],
6060
'navigation_items' => [
6161
NavigationItem::make(fn () => flexiblePagesTrans('panel.navigation_items.go_to_website_lbl'))
62-
->url('/')->openUrlInNewTab()
62+
->url('/')
63+
->openUrlInNewTab()
6364
->icon('heroicon-o-globe-alt')
6465
->sort(-100),
6566
],

src/Models/Settings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public function getTable()
6161
return FilamentFlexibleContentBlockPages::config()->getSettingsTable();
6262
}
6363

64-
public static function getSettings(): ?self
64+
public static function getSettings(): ?static
6565
{
66-
return Settings::first();
66+
return static::first();
6767
}
6868

6969
public function registerMediaCollections(): void
@@ -93,7 +93,7 @@ function () use ($settingField) {
9393
$setting = static::getSettings()->getAttribute($settingField);
9494

9595
// replace text params in settings if it is a text field (based on $translatable fields):
96-
if (in_array($settingField, (new Settings)->translatable)) {
96+
if (in_array($settingField, (new static)->translatable)) {
9797
$setting = FilamentFlexibleContentBlocks::replaceParameters($setting);
9898
}
9999

0 commit comments

Comments
 (0)