boomcms/boom-core
Core package for BoomCMS, a Laravel-based content management system. Provides foundational CMS services, models, and APIs for managing pages, content, and assets, enabling developers to build and extend BoomCMS-powered sites.
BoomCMS core is the engine, not the whole car. It supplies the page tree, templates/chunks, assets, people/permissions, admin routes, and the CMS UI; you still need a Laravel app, a theme, and a site record. If you are starting from zero, use the boomcms/boom application skeleton and treat boom-core as the dependency you read when you need to change behavior. If you are adding it to an existing Laravel app, expect to wire up more than a typical package.
Minimal path:
composer require boomcms/boom-core
Register BoomCMS\Core\Providers\BoomServiceProvider if your Laravel version does not auto-discover it, then publish and migrate:
php artisan vendor:publish --provider="BoomCMS\Core\Providers\BoomServiceProvider"
php artisan migrate
Look for install/seed commands under src/Console and route definitions in the service provider or package routes/ directory. You need at least one Site, one admin Person, and a template before the CMS is useful. The admin normally lives under /cms; confirm with:
php artisan route:list | grep -i cms
Where to look first, in order:
src/BoomCMS/Core/Providers/BoomServiceProvider.php — container bindings, route registration, view namespaces, middleware.config/boomcms.php — disks, templates path, asset config, auth/people settings.database/migrations — the real schema for pages, chunks, URLs, assets, people, groups, roles.src/BoomCMS/Core/Page — Page, Chunk, Template, and URL resolution; this is the heart of day-to-day work.First real use case: make one editable page. Define a template with named chunks, create a page using it, and render the chunks in Blade. A representative template definition looks like this (mirror an existing template in your version rather than inventing the format):
// themes/example/templates/default/template.php
return [
'name' => 'Default',
'chunks' => [
'title' => ['type' => 'text'],
'body' => ['type' => 'richtext'],
'hero' => ['type' => 'image'],
],
];
<h1>{!! $page->getChunk('title')->render() !!}</h1>
{!! $page->getChunk('body')->render() !!}
Once that renders and the admin editor can save it, you understand the core loop: template → chunks → page → URL.
Template and chunk rendering. Keep presentation in theme Blade files and let BoomCMS own the editable regions. A layout template renders the page shell, and each page template declares the chunks the editor exposes. Render chunks with render() rather than raw getContent() so chunk types (rich text, image, asset) can format themselves consistently. Reuse a shared layout for header/footer/nav so editors do not get a separate chunk set on every template.
Page operations through the service, not raw models. Creating, moving, publishing, and deleting pages has side effects: URL records, cache invalidation, permissions, and events. Use the page repository/service exposed by the BoomCMS facade or container rather than Page::create() directly:
$parent = BoomCMS::getPageByUrl('/');
$page = BoomCMS::pages()->create([
'title' => 'About us',
'parent' => $parent->getId(),
'template' => 'default',
]);
$page->publish();
Names differ by major version; confirm signatures in src/BoomCMS/Core/Page. The important pattern is to let the package own state transitions.
Front-end routing. BoomCMS resolves a request path to a page via its URL table. For normal CMS pages, rely on the package route. When you need custom controllers (a contact form, an API-backed listing), resolve the page yourself, pass it into your view, and keep the same 404 semantics for unpublished pages. Do not build a parallel slug system — you will fight the URL table.
Assets. Treat assets as first-class records, not file paths. Upload through the asset manager, attach asset IDs to chunks, and generate display URLs/thumbnails through the asset object. This keeps replacements working: an editor can swap the image behind an existing chunk without touching the template.
Permissions. BoomCMS has its own people/groups/roles model. Check permissions in custom admin controllers and hide admin UI with the same checks. Do not assume Laravel's default User model or guard is the CMS identity — BoomCMS typically uses its own person provider and guard. Mixing the two is a common source of "logged in but forbidden" bugs.
Admin extension. Add custom admin screens as normal Laravel routes wrapped in the package's admin middleware, and register menu entries through config or the package's menu/event hooks. For custom chunk types, implement the chunk class, register it, and provide the editor view/JS the admin expects. Keep custom admin code in your app, not in vendor/.
Import and maintenance scripts. Artisan commands are the safest way to bulk-create pages, migrate content, or sync from a legacy system. Wrap batches in transactions, publish explicitly, and clear page/URL caches at the end. Use php artisan tinker to prototype against real models, then move the code into a command.
Multi-site. Resolve the site before querying pages, and scope every lookup by site. Do not assume a single global page tree; URLs and page IDs are site-scoped in a multi-site install.
src/ and tests, and pin a known-good version in composer.json.body to content in a template without migrating the database makes existing content disappear from the editor.urls table by hand.storage:link, and thumbnail generation. Large uploads and non-image assets are where configuration mistakes surface first.composer update.How can I help you explore Laravel packages today?