jeffersongoncalves / laravel-cms
Laravel CMS — pages, posts, categories, tags, comments, revisions, SEO metadata, media library and navigation menus. Backend-only: models, migrations, config, contracts. Admin UI is provided by the separate filament-cms package.
Requires
- php: ^8.2
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/events: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- spatie/laravel-medialibrary: ^11.0|^12.0
- spatie/laravel-package-tools: ^1.15
- spatie/laravel-sitemap: ^7.3
- spatie/laravel-translatable: ^6.11
Requires (Dev)
- larastan/larastan: ^2.9|^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
README
Laravel CMS
Laravel CMS — pages, posts, categories, tags, comments, revisions, SEO metadata, media library and navigation menus.
Backend-only: Eloquent models, migrations, config and contracts. No routes/controllers/API — the admin UI is provided by the separate filament-cms package.
Features
- 📄 Pages and posts with categories and tags
- 💬 Comments with moderation
- 🕓 Content revisions
- 🔍 SEO metadata per model
- 🖼️ Media library integration (
spatie/laravel-medialibrary) - 🧭 Navigation menus and menu items
- 🗺️ Sitemap generation command
- 🌐 Translatable content (
spatie/laravel-translatable) - 🧩 Swap any model via config, bound through contracts
Installation
You can install the package via composer:
composer require jeffersongoncalves/laravel-cms
Publish and run the migrations:
php artisan vendor:publish --tag="cms-migrations"
php artisan migrate
Optionally publish the config files:
php artisan vendor:publish --tag="cms-config"
This publishes config/cms-core.php, config/cms-media.php and config/cms-menu.php, where you can override the model bindings used by each contract (PageContract, PostContract, CategoryContract, TagContract, CommentContract, RevisionContract, SeoContract, MenuContract, MenuItemContract).
Usage
use JeffersonGoncalves\Cms\Models\Page; use JeffersonGoncalves\Cms\Models\Post; $page = Page::create([ 'title' => ['en' => 'About us'], 'slug' => 'about-us', 'content' => ['en' => '...'], ]); $post = Post::create([ 'title' => ['en' => 'Hello world'], 'slug' => 'hello-world', 'content' => ['en' => '...'], ]);
Sitemap
Generate the sitemap with the bundled Artisan command:
php artisan cms:generate-sitemap
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
