Skip to content

Commit d241cb3

Browse files
committed
Add configuration docs.
1 parent 18e2a6a commit d241cb3

File tree

1 file changed

+213
-8
lines changed

1 file changed

+213
-8
lines changed

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

Lines changed: 213 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
// config for Statikbe/FilamentFlexibleContentBlockPages
43
use Filament\Http\Middleware\Authenticate;
54
use Filament\Http\Middleware\AuthenticateSession;
65
use Filament\Http\Middleware\DisableBladeIconComponents;
@@ -14,7 +13,25 @@
1413
use Statikbe\FilamentFlexibleContentBlockPages\FilamentFlexibleContentBlockPagesConfig;
1514
use Statikbe\FilamentFlexibleContentBlockPages\Services\Enum\SitemapGeneratorMethod;
1615

16+
/*
17+
|--------------------------------------------------------------------------
18+
| Filament Flexible Content Block Pages Configuration
19+
|--------------------------------------------------------------------------
20+
| @see https://github.com/statikbe/laravel-filament-flexible-content-block-pages/blob/main/documentation/configuration.md
21+
*/
22+
1723
return [
24+
/*
25+
|--------------------------------------------------------------------------
26+
| Model Classes
27+
|--------------------------------------------------------------------------
28+
|
29+
| Specify the model classes for each component type. This allows you to
30+
| extend the default models with your own implementations if needed.
31+
| All models should extend the corresponding base models from this package.
32+
| Except the page model, you can tailor to your exact needs by selecting the
33+
| necessary interfaces and traits.
34+
*/
1835
'models' => [
1936
FilamentFlexibleContentBlockPagesConfig::TYPE_PAGE => \Statikbe\FilamentFlexibleContentBlockPages\Models\Page::class,
2037
FilamentFlexibleContentBlockPagesConfig::TYPE_REDIRECT => \Statikbe\FilamentFlexibleContentBlockPages\Models\Redirect::class,
@@ -25,6 +42,14 @@
2542
FilamentFlexibleContentBlockPagesConfig::TYPE_MENU_ITEM => \Statikbe\FilamentFlexibleContentBlockPages\Models\MenuItem::class,
2643
],
2744

45+
/*
46+
|--------------------------------------------------------------------------
47+
| Database Table Names
48+
|--------------------------------------------------------------------------
49+
|
50+
| Define the database table names used by the package.
51+
|
52+
*/
2853
'table_names' => [
2954
FilamentFlexibleContentBlockPagesConfig::TYPE_PAGE => 'pages',
3055
FilamentFlexibleContentBlockPagesConfig::TYPE_AUTHOR => 'users',
@@ -37,6 +62,16 @@
3762
FilamentFlexibleContentBlockPagesConfig::TYPE_MENU_ITEM => 'menu_items',
3863
],
3964

65+
/*
66+
|--------------------------------------------------------------------------
67+
| Filament Resources
68+
|--------------------------------------------------------------------------
69+
|
70+
| Specify the Filament resource classes for managing each model type.
71+
| You can extend these resources to customize the admin interface
72+
| or create your own implementations.
73+
|
74+
*/
4075
'resources' => [
4176
FilamentFlexibleContentBlockPagesConfig::TYPE_PAGE => \Statikbe\FilamentFlexibleContentBlockPages\Resources\PageResource::class,
4277
FilamentFlexibleContentBlockPagesConfig::TYPE_SETTINGS => \Statikbe\FilamentFlexibleContentBlockPages\Resources\SettingsResource::class,
@@ -46,17 +81,56 @@
4681
FilamentFlexibleContentBlockPagesConfig::TYPE_MENU => \Statikbe\FilamentFlexibleContentBlockPages\Resources\MenuResource::class,
4782
],
4883

84+
/*
85+
|--------------------------------------------------------------------------
86+
| Page Resource Configuration
87+
|--------------------------------------------------------------------------
88+
|
89+
| Configure various features and options for the page resource.
90+
| These settings control which fields and functionality are available
91+
| in the page management interface.
92+
|
93+
*/
4994
'page_resource' => [
5095
\Statikbe\FilamentFlexibleContentBlockPages\Models\Page::class => [
96+
/*
97+
| Enable the feature to have call-to-action buttons in the hero of the page
98+
*/
5199
'enable_hero_call_to_actions' => true,
100+
101+
/*
102+
| Enable the feature for pages to have an author
103+
*/
52104
'enable_author' => true,
105+
106+
/*
107+
| Enable the feature for pages to have parent pages.
108+
*/
53109
'enable_parent' => true,
110+
111+
/*
112+
| Enable the feature for pages to have a boolean to make them undeletable.
113+
*/
54114
'enable_undeletable' => true,
115+
116+
/*
117+
| The Filament navigation menu sorting order of the page resource
118+
*/
55119
'navigation_sort' => 5,
56120
],
57121
// If you extend PageResource and want to use your own model, you can add your the extended page resource config for your own model here...
58122
],
59123

124+
/*
125+
|--------------------------------------------------------------------------
126+
| CMS Panel Configuration
127+
|--------------------------------------------------------------------------
128+
|
129+
| Configure the Filament CMS panel settings including the access path
130+
| and middleware stack. The middleware ensures proper authentication,
131+
| session management, and CSRF protection.
132+
|
133+
*/
60134
'panel' => [
61135
'path' => 'admin/website',
62136
'middleware' => [
@@ -75,6 +149,17 @@
75149
],
76150
],
77151

152+
/*
153+
|--------------------------------------------------------------------------
154+
| Route Helper
155+
|--------------------------------------------------------------------------
156+
|
157+
| Specify the route helper class for generating page URLs. The default
158+
| LocalisedPageRouteHelper supports multi-language sites with localized
159+
| URLs. You can implement your own route helper for custom URL patterns.
160+
| Use the PageRouteHelper for non-translatable routes.
161+
|
162+
*/
78163
'route_helper' => \Statikbe\FilamentFlexibleContentBlockPages\Routes\LocalisedPageRouteHelper::class,
79164

80165
/*
@@ -91,50 +176,154 @@
91176
*/
92177
'theme' => 'tailwind',
93178

179+
/*
180+
|--------------------------------------------------------------------------
181+
| Page Templates
182+
|--------------------------------------------------------------------------
183+
|
184+
| Define custom Blade templates for specific page types. This allows you
185+
| to override the default page rendering with custom layouts for special
186+
| pages like home pages, landing pages, or other unique page types.
187+
| Use the code of the page as key and the blade template as value.
188+
|
189+
*/
94190
'page_templates' => [
95191
// Page::HOME_PAGE => 'pages.home',
96192
],
97193

194+
/*
195+
|--------------------------------------------------------------------------
196+
| Menu Builder Configuration
197+
|--------------------------------------------------------------------------
198+
|
199+
| Configure the menu builder system including navigation sorting,
200+
| maximum depth, linkable models, and available menu styles.
201+
|
202+
*/
98203
'menu' => [
204+
/*
205+
| The Filament navigation menu sorting order of the menu resource
206+
*/
99207
'navigation_sort' => 30,
208+
209+
/*
210+
| Maximum depth allowed for menu items. Defines how many levels deep
211+
| the menu hierarchy can go (e.g., 2 = parent → child → grandchild).
212+
| This is the default value. You can override this in the menu database record.
213+
*/
100214
'max_depth' => 2,
215+
216+
/*
217+
| Enable the icon field for menu items. When enabled, menu items
218+
| can have icons assigned to them for better visual representation
219+
| in the frontend menu display.
220+
*/
101221
'enable_menu_item_icon_field' => true,
222+
223+
/*
224+
| Models that can be linked in menu items. These models must implement
225+
| the HasMenuLabel interface to provide a label for menu display, and the Linkable interface to get a url of the model.
226+
*/
102227
'linkable_models' => [
103-
// Models that can be linked in menu items
104-
// These models must implement HasMenuLabel interface
105-
// Resources are automatically discovered via FilamentFlexibleContentBlockPages::getModelResource()
106228
\Statikbe\FilamentFlexibleContentBlockPages\Models\Page::class,
107229

108230
// Add your own models here:
109231
// \App\Models\Category::class,
110232
// \App\Models\Post::class,
111233
],
234+
235+
/*
236+
| Available menu styles for frontend rendering. These are style codes
237+
| only - the actual labels in the dropdowns in the UI come from translation files.
238+
| Each style corresponds to a different menu layout/appearance.
239+
*/
112240
'styles' => [
113-
// Available menu styles (codes only - labels come from translations)
114241
'default',
115242

116243
// If needed, add your custom style(s) here:
117244
// 'mega',
245+
// 'horizontal',
246+
// 'vertical',
118247
],
119248
],
120249

250+
/*
251+
|--------------------------------------------------------------------------
252+
| Sitemap Configuration
253+
|--------------------------------------------------------------------------
254+
|
255+
| Configure sitemap generation including which content types to include,
256+
| URL patterns to exclude, and custom URLs to add.
257+
|
258+
*/
121259
'sitemap' => [
260+
/*
261+
| Enable or disable sitemap generation entirely.
262+
*/
122263
'enabled' => true,
264+
265+
/*
266+
| The default canonical locale for multilingual sites. This locale
267+
| will be used as the canonical URL in the sitemap when multiple
268+
| language versions of a page exist.
269+
*/
123270
'default_canonical_locale' => 'nl',
271+
272+
/*
273+
| The service class responsible for generating the sitemap.
274+
| You can extend or replace this with your own implementation by implementing the GeneratesSitemap interface.
275+
*/
124276
'generator_service' => \Statikbe\FilamentFlexibleContentBlockPages\Services\SitemapGeneratorService::class,
277+
278+
/*
279+
| Sitemap generation method. MANUAL requires calling the artisan command,
280+
| while AUTOMATIC generates the sitemap on each request (not recommended for production)
281+
| and HYBRID does a combination of both.
282+
*/
125283
'method' => SitemapGeneratorMethod::MANUAL,
284+
285+
/*
286+
| Include pages in the sitemap. When true, all published pages will be automatically added to the sitemap.
287+
*/
126288
'include_pages' => true,
289+
290+
/*
291+
| Include link routes in the sitemap. This adds GET routes that are defined in your application's route files.
292+
*/
127293
'include_link_routes' => true,
294+
295+
/*
296+
| Include linkable models in the sitemap. Models that implement the Linkable interface will be automatically included.
297+
*/
128298
'include_linkable_models' => true,
299+
300+
/*
301+
| URL patterns to exclude from the sitemap. Use regex patterns to match URLs that should not appear in the sitemap.
302+
*/
129303
'exclude_patterns' => [
130-
// URL patterns to exclude from sitemap
304+
// '/admin/.*',
305+
// '/test/.*',
131306
],
307+
308+
/*
309+
| Custom URLs to manually include in the sitemap. Add specific
310+
| URLs that should be included but might not be automatically discovered.
311+
*/
132312
'custom_urls' => [
133-
// Custom URLs to include in sitemap
313+
// '/special-page',
314+
// '/custom-landing',
134315
],
135316
],
136317

318+
/*
319+
|--------------------------------------------------------------------------
320+
| Redirects Configuration
321+
|--------------------------------------------------------------------------
322+
*/
137323
'redirects' => [
324+
/*
325+
| The Filament navigation menu sorting order of the redirect resource
326+
*/
138327
'navigation_sort' => 10,
139328

140329
/*
@@ -149,11 +338,27 @@
149338
'redirector' => \Statikbe\FilamentFlexibleContentBlockPages\Services\DatabaseAndConfigRedirector::class,
150339
],
151340

341+
/*
342+
|--------------------------------------------------------------------------
343+
| Settings Configuration
344+
|--------------------------------------------------------------------------
345+
*/
152346
'settings' => [
347+
/*
348+
| The Filament navigation menu sorting order of the settings resource
349+
*/
153350
'navigation_sort' => 5,
154351
],
155352

353+
/*
354+
|--------------------------------------------------------------------------
355+
| Tags Configuration
356+
|--------------------------------------------------------------------------
357+
*/
156358
'tags' => [
359+
/*
360+
| The Filament navigation menu sorting order of the tag resource
361+
*/
157362
'navigation_sort' => 20,
158363
],
159364

@@ -162,7 +367,7 @@
162367
| Tag Pages Configuration
163368
|--------------------------------------------------------------------------
164369
|
165-
| Configure how tag pages work, including which models are included
370+
| Configure how SEO tag pages work, including which models are included
166371
| and pagination settings.
167372
*/
168373
'tag_pages' => [

0 commit comments

Comments
 (0)