|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -// config for Statikbe/FilamentFlexibleContentBlockPages |
4 | 3 | use Filament\Http\Middleware\Authenticate;
|
5 | 4 | use Filament\Http\Middleware\AuthenticateSession;
|
6 | 5 | use Filament\Http\Middleware\DisableBladeIconComponents;
|
|
14 | 13 | use Statikbe\FilamentFlexibleContentBlockPages\FilamentFlexibleContentBlockPagesConfig;
|
15 | 14 | use Statikbe\FilamentFlexibleContentBlockPages\Services\Enum\SitemapGeneratorMethod;
|
16 | 15 |
|
| 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 | + |
17 | 23 | 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 | + */ |
18 | 35 | 'models' => [
|
19 | 36 | FilamentFlexibleContentBlockPagesConfig::TYPE_PAGE => \Statikbe\FilamentFlexibleContentBlockPages\Models\Page::class,
|
20 | 37 | FilamentFlexibleContentBlockPagesConfig::TYPE_REDIRECT => \Statikbe\FilamentFlexibleContentBlockPages\Models\Redirect::class,
|
|
25 | 42 | FilamentFlexibleContentBlockPagesConfig::TYPE_MENU_ITEM => \Statikbe\FilamentFlexibleContentBlockPages\Models\MenuItem::class,
|
26 | 43 | ],
|
27 | 44 |
|
| 45 | + /* |
| 46 | + |-------------------------------------------------------------------------- |
| 47 | + | Database Table Names |
| 48 | + |-------------------------------------------------------------------------- |
| 49 | + | |
| 50 | + | Define the database table names used by the package. |
| 51 | + | |
| 52 | + */ |
28 | 53 | 'table_names' => [
|
29 | 54 | FilamentFlexibleContentBlockPagesConfig::TYPE_PAGE => 'pages',
|
30 | 55 | FilamentFlexibleContentBlockPagesConfig::TYPE_AUTHOR => 'users',
|
|
37 | 62 | FilamentFlexibleContentBlockPagesConfig::TYPE_MENU_ITEM => 'menu_items',
|
38 | 63 | ],
|
39 | 64 |
|
| 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 | + */ |
40 | 75 | 'resources' => [
|
41 | 76 | FilamentFlexibleContentBlockPagesConfig::TYPE_PAGE => \Statikbe\FilamentFlexibleContentBlockPages\Resources\PageResource::class,
|
42 | 77 | FilamentFlexibleContentBlockPagesConfig::TYPE_SETTINGS => \Statikbe\FilamentFlexibleContentBlockPages\Resources\SettingsResource::class,
|
|
46 | 81 | FilamentFlexibleContentBlockPagesConfig::TYPE_MENU => \Statikbe\FilamentFlexibleContentBlockPages\Resources\MenuResource::class,
|
47 | 82 | ],
|
48 | 83 |
|
| 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 | + */ |
49 | 94 | 'page_resource' => [
|
50 | 95 | \Statikbe\FilamentFlexibleContentBlockPages\Models\Page::class => [
|
| 96 | + /* |
| 97 | + | Enable the feature to have call-to-action buttons in the hero of the page |
| 98 | + */ |
51 | 99 | 'enable_hero_call_to_actions' => true,
|
| 100 | + |
| 101 | + /* |
| 102 | + | Enable the feature for pages to have an author |
| 103 | + */ |
52 | 104 | 'enable_author' => true,
|
| 105 | + |
| 106 | + /* |
| 107 | + | Enable the feature for pages to have parent pages. |
| 108 | + */ |
53 | 109 | 'enable_parent' => true,
|
| 110 | + |
| 111 | + /* |
| 112 | + | Enable the feature for pages to have a boolean to make them undeletable. |
| 113 | + */ |
54 | 114 | 'enable_undeletable' => true,
|
| 115 | + |
| 116 | + /* |
| 117 | + | The Filament navigation menu sorting order of the page resource |
| 118 | + */ |
55 | 119 | 'navigation_sort' => 5,
|
56 | 120 | ],
|
57 | 121 | // 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...
|
58 | 122 | ],
|
59 | 123 |
|
| 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 | + */ |
60 | 134 | 'panel' => [
|
61 | 135 | 'path' => 'admin/website',
|
62 | 136 | 'middleware' => [
|
|
75 | 149 | ],
|
76 | 150 | ],
|
77 | 151 |
|
| 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 | + */ |
78 | 163 | 'route_helper' => \Statikbe\FilamentFlexibleContentBlockPages\Routes\LocalisedPageRouteHelper::class,
|
79 | 164 |
|
80 | 165 | /*
|
|
91 | 176 | */
|
92 | 177 | 'theme' => 'tailwind',
|
93 | 178 |
|
| 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 | + */ |
94 | 190 | 'page_templates' => [
|
95 | 191 | // Page::HOME_PAGE => 'pages.home',
|
96 | 192 | ],
|
97 | 193 |
|
| 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 | + */ |
98 | 203 | 'menu' => [
|
| 204 | + /* |
| 205 | + | The Filament navigation menu sorting order of the menu resource |
| 206 | + */ |
99 | 207 | '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 | + */ |
100 | 214 | '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 | + */ |
101 | 221 | '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 | + */ |
102 | 227 | '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() |
106 | 228 | \Statikbe\FilamentFlexibleContentBlockPages\Models\Page::class,
|
107 | 229 |
|
108 | 230 | // Add your own models here:
|
109 | 231 | // \App\Models\Category::class,
|
110 | 232 | // \App\Models\Post::class,
|
111 | 233 | ],
|
| 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 | + */ |
112 | 240 | 'styles' => [
|
113 |
| - // Available menu styles (codes only - labels come from translations) |
114 | 241 | 'default',
|
115 | 242 |
|
116 | 243 | // If needed, add your custom style(s) here:
|
117 | 244 | // 'mega',
|
| 245 | + // 'horizontal', |
| 246 | + // 'vertical', |
118 | 247 | ],
|
119 | 248 | ],
|
120 | 249 |
|
| 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 | + */ |
121 | 259 | 'sitemap' => [
|
| 260 | + /* |
| 261 | + | Enable or disable sitemap generation entirely. |
| 262 | + */ |
122 | 263 | '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 | + */ |
123 | 270 | '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 | + */ |
124 | 276 | '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 | + */ |
125 | 283 | 'method' => SitemapGeneratorMethod::MANUAL,
|
| 284 | + |
| 285 | + /* |
| 286 | + | Include pages in the sitemap. When true, all published pages will be automatically added to the sitemap. |
| 287 | + */ |
126 | 288 | '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 | + */ |
127 | 293 | 'include_link_routes' => true,
|
| 294 | + |
| 295 | + /* |
| 296 | + | Include linkable models in the sitemap. Models that implement the Linkable interface will be automatically included. |
| 297 | + */ |
128 | 298 | '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 | + */ |
129 | 303 | 'exclude_patterns' => [
|
130 |
| - // URL patterns to exclude from sitemap |
| 304 | + // '/admin/.*', |
| 305 | + // '/test/.*', |
131 | 306 | ],
|
| 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 | + */ |
132 | 312 | 'custom_urls' => [
|
133 |
| - // Custom URLs to include in sitemap |
| 313 | + // '/special-page', |
| 314 | + // '/custom-landing', |
134 | 315 | ],
|
135 | 316 | ],
|
136 | 317 |
|
| 318 | + /* |
| 319 | + |-------------------------------------------------------------------------- |
| 320 | + | Redirects Configuration |
| 321 | + |-------------------------------------------------------------------------- |
| 322 | + */ |
137 | 323 | 'redirects' => [
|
| 324 | + /* |
| 325 | + | The Filament navigation menu sorting order of the redirect resource |
| 326 | + */ |
138 | 327 | 'navigation_sort' => 10,
|
139 | 328 |
|
140 | 329 | /*
|
|
149 | 338 | 'redirector' => \Statikbe\FilamentFlexibleContentBlockPages\Services\DatabaseAndConfigRedirector::class,
|
150 | 339 | ],
|
151 | 340 |
|
| 341 | + /* |
| 342 | + |-------------------------------------------------------------------------- |
| 343 | + | Settings Configuration |
| 344 | + |-------------------------------------------------------------------------- |
| 345 | + */ |
152 | 346 | 'settings' => [
|
| 347 | + /* |
| 348 | + | The Filament navigation menu sorting order of the settings resource |
| 349 | + */ |
153 | 350 | 'navigation_sort' => 5,
|
154 | 351 | ],
|
155 | 352 |
|
| 353 | + /* |
| 354 | + |-------------------------------------------------------------------------- |
| 355 | + | Tags Configuration |
| 356 | + |-------------------------------------------------------------------------- |
| 357 | + */ |
156 | 358 | 'tags' => [
|
| 359 | + /* |
| 360 | + | The Filament navigation menu sorting order of the tag resource |
| 361 | + */ |
157 | 362 | 'navigation_sort' => 20,
|
158 | 363 | ],
|
159 | 364 |
|
|
162 | 367 | | Tag Pages Configuration
|
163 | 368 | |--------------------------------------------------------------------------
|
164 | 369 | |
|
165 |
| - | Configure how tag pages work, including which models are included |
| 370 | + | Configure how SEO tag pages work, including which models are included |
166 | 371 | | and pagination settings.
|
167 | 372 | */
|
168 | 373 | 'tag_pages' => [
|
|
0 commit comments