jeffersongoncalves / laravel-cms-core
CMS core — pages, posts, categories, tags, comments, revisions, SEO metadata, i18n and sitemap generation for the Laravel CMS ecosystem
Package info
github.com/jeffersongoncalves/laravel-cms-core
pkg:composer/jeffersongoncalves/laravel-cms-core
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-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 Core
Pages, posts, categories, tags, comments, revisions, SEO metadata, i18n and sitemap generation. Backend-only: models, migrations, config — no routes, controllers or API.
Installation
composer require jeffersongoncalves/laravel-cms-core
php artisan vendor:publish --tag="cms-core-config"
php artisan migrate
Content models
Page— hierarchical (parent_id), translatabletitle/slug/body,draft/publishedstatus.Post— translatabletitle/slug/excerpt/body,draft/published/scheduledstatus, optionalauthor_id.
Both use Categorizable, Taggable, HasComments, HasRevisions and HasSeo concerns.
Taxonomy
Category (hierarchical) and Tag attach to any model via the Categorizable / Taggable traits (polymorphic pivot tables).
Comments
Comment is polymorphic (commentable) and threaded (parent_id), with pending/approved/spam status.
Revisions
HasRevisions snapshots the previous state of revisionable() fields (defaults to $fillable) before every update. Restore with:
$post->restoreRevision($revisionId);
SEO
HasSeo exposes a polymorphic seo relation (Seo model: translatable meta_title/meta_description, meta_image, canonical_url):
$post->fillSeo(['meta_title' => ['en' => 'Custom title']]);
i18n
Translatable fields are powered by spatie/laravel-translatable. Configure available locales in config/cms-core.php.
Sitemap
php artisan cms:generate-sitemap
Writes sitemap.xml from published pages/posts, using the URL resolvers configured in config('cms-core.sitemap.resolvers') — override these from the host application once routes exist.
