Getting Started
Start by treating dashed/dashed-pages as an early-stage Laravel CMS pages package: verify its service provider, config, migrations, routes, models, and admin integration inside vendor/dashed/dashed-pages before designing around it. The README and composer.json are the first places to check for Laravel/PHP version constraints, publishable assets, and required DashedCMS dependencies.
Minimal adoption path:
- Install with Composer and confirm the package discovers correctly in the target Laravel version.
- Publish config, migrations, views, and assets using the provider/tag names documented by the package; if docs are thin, inspect the service provider’s
publishes() and boot() methods.
- Run migrations and seed a single page record.
- Confirm route registration, especially any slug/catch-all route, does not conflict with existing application routes.
- Render the page through the package’s expected Blade view or your own template override.
The first practical use case is CMS-managed static/marketing pages: legal pages, landing pages, About/Contact content, and simple SEO pages managed by non-developers while developers control templates and routing.
Implementation Patterns
Use the package as the content store and routing layer, but keep presentation in Blade templates and application code. A day-to-day pattern is to map page types or templates to explicit Blade views rather than allowing arbitrary view selection from admin input.
Common patterns:
- Slug-based page rendering: register the package route late in the route stack, constrain slugs where possible, and keep application-specific routes above it.
- Template mapping: define a small allowlist of page templates in config and resolve them through a presenter/view model. This keeps admin choices predictable and avoids stale view references.
- Published/draft workflow: scope public queries to published pages, use signed preview URLs or admin middleware for drafts, and invalidate caches when status changes.
- Caching: cache rendered page output by page ID, slug, locale, and updated timestamp. Clear or version the cache on save/publish/delete through model events or observers.
- Navigation and sitemap generation: query the page repository for published pages and build nav/sitemap data in application services rather than inside Blade templates.
- Admin integration: if the package exposes CRUD screens, wrap them in your existing authorization policies. If it does not, build a thin admin resource around the package model.
- Deployment workflow: include migrations, config cache rebuilds, view cache clears, and published asset refreshes in deploy scripts. Seed required system pages through idempotent seeders or content migrations.
- Testing: use model factories or direct model creation with
RefreshDatabase; assert route resolution, draft visibility, template rendering, slug uniqueness, and cache invalidation.
For larger sites, treat pages as structured records with fields for title, slug, status, template, SEO metadata, and body/blocks. Avoid letting the package become an untyped blob store; validate content at the application boundary.
Gotchas and Tips
- Low adoption signal: zero stars/dependents and sparse ecosystem examples mean you should budget time for source inspection. Do not assume documented behavior matches the released code.
- Release metadata anomaly: the listed last release date is in the future relative to normal adoption checks. Verify the actual tagged version and changelog before relying on it in production.
- Catch-all route conflicts: page slug routes commonly shadow existing routes. Register package routes last, add slug constraints, and test
php artisan route:list after installation.
- Publish collisions: config, migrations, and views may collide with existing files. Publish selectively and commit published files deliberately.
- Config and view caching: after changing package config or overriding views, run
php artisan config:clear and php artisan view:clear; in production, rebuild caches as part of deployment.
- Slug uniqueness: enforce uniqueness at the database and validation layers, including soft-deleted records if applicable. Handle slug changes with redirects to avoid broken links.
- Draft leakage: ensure public queries, sitemaps, navigation, and caches all exclude unpublished pages. Preview routes should require authorization or signed URLs.
- Cache invalidation: page updates often leave stale rendered HTML. Hook model saved/deleted events or use cache keys based on
updated_at.
- Template safety: avoid letting admin users select arbitrary Blade views. Use an allowlisted template map.
- SEO edge cases: handle null meta titles/descriptions, canonical URLs, and localization explicitly rather than assuming the package does.
- Debugging checklist: inspect the service provider boot method, published config keys, route list, migration status, model fillable/casts, and rendered view path. Use
php artisan about, route:list, and targeted dd(config(...)) checks.
- Extension points: prefer custom page types, template overrides, model observers, route constraints, and repository/service wrappers over editing vendor files.