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 44
55use Illuminate \View \Component ;
66use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
7+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
78
89class BaseLayout extends Component
910{
1011 public function render ()
1112 {
1213 $ theme = FilamentFlexibleContentBlockPages::config ()->getTheme ();
1314
14- return view ( " filament-flexible-content-block-pages:: {$ theme }.components.layouts.base " );
15+ return flexiblePagesView ( " {$ theme }.components.layouts.base " );
1516 }
1617}
Original file line number Diff line number Diff line change 55use Illuminate \View \Component ;
66use Mcamara \LaravelLocalization \Facades \LaravelLocalization ;
77use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
8+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
89
910class LanguageSwitch extends Component
1011{
1112 public function render ()
1213 {
1314 $ 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 " ;
1517
1618 // Check if the themed template exists, otherwise fallback to tailwind theme
1719 if (view ()->exists ($ template )) {
@@ -20,7 +22,7 @@ public function render()
2022
2123 // Final fallback to tailwind theme
2224 /** @var view-string $fallbackTemplate */
23- $ fallbackTemplate = ' filament-flexible-content-block-pages ::tailwind.components.language-switch' ;
25+ $ fallbackTemplate = "{ $ package } ::tailwind.components.language-switch " ;
2426
2527 return view ($ fallbackTemplate );
2628 }
Original file line number Diff line number Diff line change 44
55use Illuminate \View \Component ;
66use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
7+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
78
89class Menu extends Component
910{
@@ -38,14 +39,15 @@ public function __construct(
3839 public function render ()
3940 {
4041 $ 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 }" ;
4244
4345 // Check if the themed style template exists, otherwise try default style in theme
4446 if (view ()->exists ($ template )) {
4547 return view ($ template );
4648 }
4749
48- $ defaultTemplate = "filament-flexible-content-block-pages :: {$ theme }.components.menu.default " ;
50+ $ defaultTemplate = "{ $ package } :: {$ theme }.components.menu.default " ;
4951
5052 return view ($ defaultTemplate );
5153 }
Original file line number Diff line number Diff line change 44
55use Illuminate \View \Component ;
66use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
7+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
78use Statikbe \FilamentFlexibleContentBlockPages \Models \MenuItem as MenuItemModel ;
89
910class MenuItem extends Component
@@ -27,14 +28,15 @@ public function __construct(
2728 public function render ()
2829 {
2930 $ 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 " ;
3133
3234 // Check if the themed style item template exists, otherwise try default item in theme
3335 if (view ()->exists ($ template )) {
3436 return view ($ template );
3537 }
3638
37- $ defaultTemplate = "filament-flexible-content-block-pages :: {$ theme }.components.menu.default-item " ;
39+ $ defaultTemplate = "{ $ package } :: {$ theme }.components.menu.default-item " ;
3840
3941 return view ($ defaultTemplate );
4042 }
Original file line number Diff line number Diff line change 77use Illuminate \Support \Facades \Route ;
88use InvalidArgumentException ;
99use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
10+ use Statikbe \FilamentFlexibleContentBlockPages \FilamentFlexibleContentBlockPagesServiceProvider ;
1011use Statikbe \FilamentFlexibleContentBlockPages \Models \Contracts \HasMenuLabel ;
1112use Statikbe \FilamentFlexibleContentBlockPages \Models \Menu ;
1213use Statikbe \FilamentFlexibleContentBlockPages \Models \MenuItem ;
@@ -141,7 +142,7 @@ protected function createMenuItemForPageCode(
141142 menu: $ menu ,
142143 model: $ model ,
143144 label: $ label ,
144- link_type: ' filament-flexible-content-block-pages ::page ' ,
145+ link_type: FilamentFlexibleContentBlockPagesServiceProvider:: PACKAGE_PREFIX . ' ::page ' ,
145146 useModelTitle: $ useModelTitle ,
146147 isVisible: $ isVisible ,
147148 target: $ target ,
Original file line number Diff line number Diff line change @@ -390,6 +390,6 @@ public function getTagPageRoutePrefix(): string
390390
391391 private function packageConfig (string $ configKey , $ default = null ): mixed
392392 {
393- return config (' filament-flexible-content-block-pages . ' .$ configKey , $ default );
393+ return config (FilamentFlexibleContentBlockPagesServiceProvider:: PACKAGE_PREFIX . ' . ' .$ configKey , $ default );
394394 }
395395}
Original file line number Diff line number Diff line change 2121
2222class FilamentFlexibleContentBlockPagesServiceProvider extends PackageServiceProvider
2323{
24+ const PACKAGE_PREFIX = 'filament-flexible-content-block-pages ' ;
25+
2426 public function configurePackage (Package $ package ): void
2527 {
26- /*
27- * This class is a Package Service Provider
28- *
29- * More info: https://github.com/spatie/laravel-package-tools
30- */
3128 $ package
32- ->name ('laravel-filament-flexible-content-block-pages ' )
29+ ->name ('laravel- ' . self :: PACKAGE_PREFIX )
3330 ->hasConfigFile ()
3431 ->hasViews ()
3532 ->hasMigrations ([
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ final class FlexibleContentBlockPagesPlugin implements Plugin
1919
2020 public function getId (): string
2121 {
22- return ' filament-flexible-content-block-pages ' ;
22+ return FilamentFlexibleContentBlockPagesServiceProvider:: PACKAGE_PREFIX ;
2323 }
2424
2525 public function register (Panel $ panel ): void
Original file line number Diff line number Diff line change 1515
1616abstract class AbstractSeoPageController extends Controller
1717{
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 ' ;
1919
2020 const CACHE_SEO_IMAGE_TTL = 60 * 60 * 8 ; // in seconds
2121
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public function allMenuItems(): HasMany
5454
5555 public function getMorphClass ()
5656 {
57- return ' filament-flexible-content-block-pages:: menu ' ;
57+ return flexiblePagesPrefix ( ' menu ') ;
5858 }
5959
6060 public function getEffectiveStyle (): string
You can’t perform that action at this time.
0 commit comments