File tree Expand file tree Collapse file tree 17 files changed +47
-27
lines changed Expand file tree Collapse file tree 17 files changed +47
-27
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \View \Component ;
6
6
use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
7
+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
7
8
8
9
class BaseLayout extends Component
9
10
{
10
11
public function render ()
11
12
{
12
13
$ theme = FilamentFlexibleContentBlockPages::config ()->getTheme ();
13
14
14
- return view ( " filament-flexible-content-block-pages:: {$ theme }.components.layouts.base " );
15
+ return flexiblePagesView ( " {$ theme }.components.layouts.base " );
15
16
}
16
17
}
Original file line number Diff line number Diff line change 5
5
use Illuminate \View \Component ;
6
6
use Mcamara \LaravelLocalization \Facades \LaravelLocalization ;
7
7
use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
8
+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
8
9
9
10
class LanguageSwitch extends Component
10
11
{
11
12
public function render ()
12
13
{
13
14
$ theme = FilamentFlexibleContentBlockPages::config ()->getTheme ();
14
- $ template = "filament-flexible-content-block-pages:: {$ theme }.components.language-switch " ;
15
+ $ package = FilamentFlexibleContentBlockPagesServiceProvider::PACKAGE_PREFIX ;
16
+ $ template = "{$ package }:: {$ theme }.components.language-switch " ;
15
17
16
18
// Check if the themed template exists, otherwise fallback to tailwind theme
17
19
if (view ()->exists ($ template )) {
@@ -20,7 +22,7 @@ public function render()
20
22
21
23
// Final fallback to tailwind theme
22
24
/** @var view-string $fallbackTemplate */
23
- $ fallbackTemplate = ' filament-flexible-content-block-pages ::tailwind.components.language-switch' ;
25
+ $ fallbackTemplate = "{ $ package } ::tailwind.components.language-switch " ;
24
26
25
27
return view ($ fallbackTemplate );
26
28
}
Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \View \Component ;
6
6
use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
7
+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
7
8
8
9
class Menu extends Component
9
10
{
@@ -38,14 +39,15 @@ public function __construct(
38
39
public function render ()
39
40
{
40
41
$ theme = FilamentFlexibleContentBlockPages::config ()->getTheme ();
41
- $ template = "filament-flexible-content-block-pages:: {$ theme }.components.menu. {$ this ->style }" ;
42
+ $ package = FilamentFlexibleContentBlockPagesServiceProvider::PACKAGE_PREFIX ;
43
+ $ template = "$ package:: {$ theme }.components.menu. {$ this ->style }" ;
42
44
43
45
// Check if the themed style template exists, otherwise try default style in theme
44
46
if (view ()->exists ($ template )) {
45
47
return view ($ template );
46
48
}
47
49
48
- $ defaultTemplate = "filament-flexible-content-block-pages :: {$ theme }.components.menu.default " ;
50
+ $ defaultTemplate = "{ $ package } :: {$ theme }.components.menu.default " ;
49
51
50
52
return view ($ defaultTemplate );
51
53
}
Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \View \Component ;
6
6
use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
7
+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
7
8
use Statikbe \FilamentFlexibleContentBlockPages \Models \MenuItem as MenuItemModel ;
8
9
9
10
class MenuItem extends Component
@@ -27,14 +28,15 @@ public function __construct(
27
28
public function render ()
28
29
{
29
30
$ theme = FilamentFlexibleContentBlockPages::config ()->getTheme ();
30
- $ template = "filament-flexible-content-block-pages:: {$ theme }.components.menu. {$ this ->style }-item " ;
31
+ $ package = FilamentFlexibleContentBlockPagesServiceProvider::PACKAGE_PREFIX ;
32
+ $ template = "{$ package }:: {$ theme }.components.menu. {$ this ->style }-item " ;
31
33
32
34
// Check if the themed style item template exists, otherwise try default item in theme
33
35
if (view ()->exists ($ template )) {
34
36
return view ($ template );
35
37
}
36
38
37
- $ defaultTemplate = "filament-flexible-content-block-pages :: {$ theme }.components.menu.default-item " ;
39
+ $ defaultTemplate = "{ $ package } :: {$ theme }.components.menu.default-item " ;
38
40
39
41
return view ($ defaultTemplate );
40
42
}
Original file line number Diff line number Diff line change 7
7
use Illuminate \Support \Facades \Route ;
8
8
use InvalidArgumentException ;
9
9
use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
10
+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
10
11
use Statikbe \FilamentFlexibleContentBlockPages \Models \Contracts \HasMenuLabel ;
11
12
use Statikbe \FilamentFlexibleContentBlockPages \Models \Menu ;
12
13
use Statikbe \FilamentFlexibleContentBlockPages \Models \MenuItem ;
@@ -141,7 +142,7 @@ protected function createMenuItemForPageCode(
141
142
menu: $ menu ,
142
143
model: $ model ,
143
144
label: $ label ,
144
- link_type: ' filament-flexible-content-block-pages ::page ' ,
145
+ link_type: FilamentFlexibleContentBlockPagesServiceProvider:: PACKAGE_PREFIX . ' ::page ' ,
145
146
useModelTitle: $ useModelTitle ,
146
147
isVisible: $ isVisible ,
147
148
target: $ target ,
Original file line number Diff line number Diff line change @@ -390,6 +390,6 @@ public function getTagPageRoutePrefix(): string
390
390
391
391
private function packageConfig (string $ configKey , $ default = null ): mixed
392
392
{
393
- return config (' filament-flexible-content-block-pages . ' .$ configKey , $ default );
393
+ return config (FilamentFlexibleContentBlockPagesServiceProvider:: PACKAGE_PREFIX . ' . ' .$ configKey , $ default );
394
394
}
395
395
}
Original file line number Diff line number Diff line change 21
21
22
22
class FilamentFlexibleContentBlockPagesServiceProvider extends PackageServiceProvider
23
23
{
24
+ const PACKAGE_PREFIX = 'filament-flexible-content-block-pages ' ;
25
+
24
26
public function configurePackage (Package $ package ): void
25
27
{
26
- /*
27
- * This class is a Package Service Provider
28
- *
29
- * More info: https://github.com/spatie/laravel-package-tools
30
- */
31
28
$ package
32
- ->name ('laravel-filament-flexible-content-block-pages ' )
29
+ ->name ('laravel- ' . self :: PACKAGE_PREFIX )
33
30
->hasConfigFile ()
34
31
->hasViews ()
35
32
->hasMigrations ([
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ final class FlexibleContentBlockPagesPlugin implements Plugin
19
19
20
20
public function getId (): string
21
21
{
22
- return ' filament-flexible-content-block-pages ' ;
22
+ return FilamentFlexibleContentBlockPagesServiceProvider:: PACKAGE_PREFIX ;
23
23
}
24
24
25
25
public function register (Panel $ panel ): void
Original file line number Diff line number Diff line change 15
15
16
16
abstract class AbstractSeoPageController extends Controller
17
17
{
18
- const CACHE_SEO_IMAGE_DIMENSIONS = 'seo_image_dimensions:%s ' ;
18
+ const CACHE_SEO_IMAGE_DIMENSIONS = 'filament-flexible-content-block-pages:: seo_image_dimensions:%s ' ;
19
19
20
20
const CACHE_SEO_IMAGE_TTL = 60 * 60 * 8 ; // in seconds
21
21
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public function allMenuItems(): HasMany
54
54
55
55
public function getMorphClass ()
56
56
{
57
- return ' filament-flexible-content-block-pages:: menu ' ;
57
+ return flexiblePagesPrefix ( ' menu ') ;
58
58
}
59
59
60
60
public function getEffectiveStyle (): string
You can’t perform that action at this time.
0 commit comments