dominservice / laravel-cms
Laravel CMS Backend
Requires
- php: ^8.3
- ext-gd: *
- astrotomic/laravel-translatable: ^11.17.1
- dominservice/laravel-config: ^2.3.2|^3.0
- dominservice/laravel-media-kit: ^1.2.4|^2.0
- kalnoy/nestedset: ^7.0
- laravel/framework: ^13.32
- livewire/livewire: ^4.4
Requires (Dev)
- orchestra/testbench: ^11.3
- phpunit/phpunit: ^13.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 5.1.1
- 5.1.0
- 5.0.1
- 5.0.0
- 4.4.7
- 4.4.6
- 4.4.5
- 4.4.4
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.1
- 4.3.0
- 4.2.5
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.10
- 4.1.9
- 4.1.8
- 4.1.7
- 4.1.6
- 4.1.5
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.0
- 3.7.3
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.0
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.5
- 3.4.4
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.12
- 3.3.11
- 3.3.10
- 3.3.9
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.0
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.1.1
- 1.1.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2026-10-02 11:54:06 UTC
README
dominservice/laravel-cms
Reusable Laravel CMS for multilingual pages, blocks, categories and media-driven content structures.
What This Package Solves
dominservice/laravel-cms is designed for projects that need a practical CMS layer on top of Laravel, without locking the application into a closed website builder.
It gives you:
- multilingual
pageandblockcontent models, - configurable admin sections for content and categories,
- config-driven settings dashboards,
- Media Kit integration for images and video slots,
- publishable views that can be adapted to any admin theme,
- a structure that can start as a company website and grow into a larger CRM, ERP or portal.
Key Features
- multilingual contents and categories,
- nested category trees,
- configurable admin routes, middleware, layout mode and route names,
- block-oriented homepage and static page management via
cms.default_pages.*, - configurable block schemas stored in
meta, - repeater fields for cards, FAQ items and similar structured content,
- Editor.js profile support for rich text fields,
- media slots for desktop/mobile image and video handling,
- direct integration with
dominservice/laravel-media-kit, including reusable library assets, - publishable views and language files.
Requirements
The 5.x package line targets the current DominPress application stack:
- PHP 8.3 or newer,
- Laravel 13.32 or newer,
- Livewire 4.4 or newer,
kalnoy/nestedset7.x.
Laravel 9–12 and Livewire 3 remain supported by the previous 4.x package line. They are not supported by 5.x because the current kalnoy/nestedset release requires Illuminate 13.
Installation
composer require dominservice/laravel-cms dominservice/laravel-media-kit php artisan vendor:publish --provider="Dominservice\LaravelCms\ServiceProvider" --tag=config php artisan vendor:publish --provider="Dominservice\LaravelCms\ServiceProvider" --tag=views php artisan vendor:publish --provider="Dominservice\LaravelCms\ServiceProvider" --tag=lang php artisan vendor:publish --provider="Dominservice\LaravelCms\ServiceProvider" --tag=migrations php artisan vendor:publish --provider="Dominservice\MediaKit\MediaKitServiceProvider" --tag=mediakit-config php artisan vendor:publish --provider="Dominservice\MediaKit\MediaKitServiceProvider" --tag=mediakit-migrations php artisan migrate
Admin Panel
The package includes a configurable admin panel for content, categories and settings.
Main configuration lives in config/cms.php:
cms.admin.enabledcms.admin.prefixcms.admin.route_name_prefixcms.admin.middlewarecms.admin.components.*cms.admin.layout.modecms.admin.layout.viewcms.admin.layout.sectioncms.admin.layout.component
Layout integration supports three modes:
package: use package-provided layout,extends: render inside your existing Blade layout,component: render inside a Blade component.
This makes it easy to keep package logic inside the package, while styling the UI in the host project through published views.
Applications may replace individual admin Livewire classes without duplicating the package routes. Every configured class must extend Livewire\Component; omitted keys keep the package implementation:
'admin' => [ 'components' => [ 'content_index' => \App\Livewire\Cms\ContentIndex::class, 'content_form' => \App\Livewire\Cms\ContentForm::class, 'category_index' => \App\Livewire\Cms\CategoryIndex::class, 'category_form' => \App\Livewire\Cms\CategoryForm::class, 'settings_dashboard' => \App\Livewire\Cms\SettingsDashboard::class, ], ],
The content and category index classes expose filterMappedItems() as a protected extension hook. A host integration can therefore add allowlisted search and sorting while retaining section resolution, URLs and delete behavior from the package.
Content Types, Blocks and Schemas
The package supports configurable content and category types. You can keep simple arrays in config or point to your own enum classes.
'types' => [ 'content' => \App\Enums\CmsContentType::class, 'category' => \App\Enums\CmsCategoryType::class, ],
For block-based pages you can define sections in config and assign form fields, media slots and schema fields per section or block.
Typical use cases:
- homepage sections such as
hero,about,services,faq,cta, - static pages with configurable visual variants,
- reusable block types for landing pages and company websites.
Schema Fields in meta
Block-specific configuration is stored in meta, so the host project can render frontend components using its own Blade views and CSS.
The Livewire form renders and validates these fields automatically. Adding a field does not require a migration, controller, Livewire component or another Bootstrap/Tailwind template:
'admin' => [ 'content' => [ 'schema_presets' => [ 'cta' => [ 'cta_label' => [ 'type' => 'text', 'translatable' => true, ], 'cta_url' => 'url', ], ], 'sections' => [ 'home' => [ 'label' => 'Home', 'blocks' => [ 'hero' => [ 'type' => 'block', 'schema_presets' => ['cta'], 'schema_fields' => [ 'eyebrow' => [ 'translatable' => true, 'required' => true, ], 'alignment' => [ 'type' => 'select', 'options' => [ 'left' => 'Left', 'center' => 'Center', ], 'default' => 'left', ], 'metrics' => [ 'type' => 'repeater', 'translatable' => true, 'synchronize_structure' => true, 'fields' => [ 'value' => ['required' => true], 'label' => 'text', ], ], ], ], ], ], ], ], ],
Supported field types are text, textarea, editorjs, url, email, number, date, datetime-local, select, checkbox/boolean/toggle and one-level repeater. A string value is shorthand for a type, for example 'cta_url' => 'url'. Use required, default, placeholder, help, options and rules to customize a field. Explicit rules replace the inferred validation rules.
Non-translatable values are stored directly in Content::meta; translated values are stored under meta._translations.{locale}. This schema layer changes form generation only and does not replace the host project's theme or public Blade components.
Media Integration
The package uses dominservice/laravel-media-kit as the media layer.
Current integration supports:
- desktop and mobile images,
- desktop and mobile video posters,
- image and video slots in CMS forms,
- importing already uploaded assets from the shared media library,
- keeping CMS views publishable, so the host project can replace the UI without changing package logic.
Media Picker Configuration
'admin' => [ 'content' => [ 'media_picker' => [ 'enabled' => true, 'browse_route' => 'admin.media.index', 'label' => 'Biblioteka mediów', 'helper' => 'Wybierz istniejący asset z biblioteki lub wgraj nowy plik.', ], ], ],
The package exposes backend support for selecting library asset UUIDs. The host project can publish and extend the form views to provide a custom picker UX.
Editor.js Profiles
The package supports Editor.js configuration profiles so projects can choose a richer or more compact toolset per field.
Example:
'admin' => [ 'content' => [ 'editorjs' => [ 'profiles' => [ 'default' => [ 'tools' => ['paragraph', 'header', 'list', 'quote'], ], 'compact' => [ 'tools' => ['paragraph', 'list'], ], ], 'field_profiles' => [ 'description' => 'default', 'faq_items.answer' => 'compact', ], ], ], ],
Settings Dashboard
The settings dashboard is driven by configuration and can sync UUID-based assignments back into structured config arrays.
Useful for:
- assigning homepage page UUIDs,
- assigning homepage blocks,
- syncing public menu structures,
- storing multilingual meta fields,
- managing config-driven CMS sections without writing extra controllers.
Views and Overrides
The package is meant to be published and themed.
php artisan vendor:publish --provider="Dominservice\LaravelCms\ServiceProvider" --tag=views php artisan vendor:publish --provider="Dominservice\LaravelCms\ServiceProvider" --tag=lang
Recommended approach:
- keep routes, controllers, Livewire classes and storage logic in the package,
- publish package views,
- override the views in the host project to match the chosen admin theme.
This keeps the CMS reusable between projects while still allowing tailored UI.
Extensibility
The package is intentionally config-first and open to project-level extension.
You can extend it through:
- your own enum classes for content and category types,
- additional block schemas in app config,
- published views,
- custom frontend renderers,
- custom permissions and middleware on admin routes,
- custom settings panels and sync indexes.
Upgrade Notes
When upgrading existing projects:
- merge new config keys instead of overwriting the whole file,
- republish views only if you want the new default UI,
- republish migrations only when needed,
- verify
media-kitconfig and routes if you use the shared media library.
Upgrading from 4.x to 5.x
- upgrade the host application to PHP 8.3+, Laravel 13.32+ and Livewire 4.4+ first,
- review published Livewire views before replacing them with the package defaults,
- if the host application customizes
Livewire::setUpdateRoute(), update its callback to accept both$handleand$path, then register the route using the hash-aware$pathsupplied by Livewire 4, - clear application caches after updating the package and run the host application's CMS and browser-facing regression tests.
License
MIT
