Introduction to TruCMS Development

TruCMS is a modular Laravel website builder and application platform. This guide shows you how to use every part of it, how to create your own plugins and themes, and how to extend the platform through the hooks it exposes.

TruCMS is a server-rendered Laravel application. A core provides content management, a visual page builder, themes, multilingual content, media, roles and permissions, menus, widgets, settings, updates and a plugin system. On top of that core sit installable modules: TruCommerce (shop and POS), Booking (appointments), TruPayments (payment hub) and four gateway add-ons (Stripe, PayPal, Braintree, Mollie). Your own extensions are built exactly like these modules.

Two documentation sets

Site owners have their own user guide, which covers installation, everyday administration and the bundled modules screen by screen. This developer guide is for people who read, extend or maintain the code, and it does not repeat the user guide's step-by-step screens.

How to read this guide

You want to…Go to
Understand how everything fits togetherArchitecture overview
Set up a machine and run the testsLocal development
Learn what each admin screen does and which code backs itUsing TruCMS
Understand modules, plugins and their lifecycleHow the plugin system works
Build something end to endTutorial: build a plugin
Pick the right extension point for a goalWhat can I extend?
Build or customise a themeCreating a theme
Look up a facade, helper, command, permission or hookReference

The platform in one picture

+---------------------------------------------------------------------------+
|  CORE (app/, routes/, config/, resources/themes/)                         |
|  pages  posts  taxonomy  menus  widgets  ads  users  roles  teams         |
|  tickets  settings  themes  plugin manager  page builder  slugs           |
+---------------------------------------------------------------------------+
|  HOOK LAYER  (the only way modules touch the core)                        |
|  AdminBooting event | MenuManager | SettingsManager | Dashboard           |
|  Shortcode registry | Widgets | AppPages | BindingSourceRegistry | Roles   |
+----------------+----------------+----------------+------------------------+
|  TruPayments   |  TruCommerce   |  Booking       |  YOUR PLUGIN           |
|  payment hub   |  shop + POS    |  wizard+cabinet|  Modules/YourPlugin    |
+----------------+----------------+----------------+------------------------+
|  Gateway add-ons: Stripe | PayPal | Braintree | Mollie                    |
+---------------------------------------------------------------------------+

The core never needs to know about a business module, and modules reach the core only through the hook layer. That is what makes it safe to add or remove a plugin without editing core files, and why core updates never touch your plugin. The few places where the code does not follow this rule yet are listed in Known quirks.

Technology stack

You only need to know a few of the libraries underneath TruCMS, because their APIs show through in plugin code:

ConcernWhat TruCMS usesWhere you meet it
FrameworkLaravel 13 on PHP 8.4 or newerEverywhere
ViewsBlade, server-rendered. There is no single-page front endAdmin and public screens
Modulesnwidart/laravel-modulesPlugin structure, module:* commands, the Module facade
Admin UI / public UICoreUI 4 and Bootstrap 5.3 / Bootstrap 5.3 with Echo's styles, built with ViteYour markup
Page builderGrapesJS with TruCMS's shortcode, template and binding layersShortcodes and data-bound sections
Permissionsspatie/laravel-permissionPermission, Role, ->can()
Mediaspatie/laravel-medialibraryHasMedia models and uploads
Widgetsarrilot/laravel-widgetsFront and dashboard widget classes
Payments and shopThe Vanilo frameworkPayable, payment events, gateway contracts
QualityPest, Laravel Pint, PHPStan (Larastan)Tests and checks

The four ways to extend TruCMS

  1. Plugins (modules)Add routes, models, migrations, admin screens, settings, widgets, page-builder blocks and payment gateways. Start with How the plugin system works.
  2. SettingsAdd admin configuration screens whose fields store to the database, to .env, or to uploads; or add theme options. See Settings screens.
  3. ThemesChange the public design: layouts, header and footer presets, colour schema, Sass. See Creating a theme.
  4. Dynamic partsAnything data-driven at render time: shortcodes, Blade components, widgets, dashboard widgets, data-bound sections, menus and resolvable page types. See What can I extend?.

Ground rules you will see repeated

They apply to everything you add, and Conventions and rules explains each one.

What you can build — at a glance

GoalMechanismGuide
A new admin area with its own tables and screensPlugin + routes + sidebar itemTutorial
A configuration pageSettingsManager::add() inside an AdminBooting listenerSettings
A block editors drag into pagesShortcode class + Blade componentShortcodes
A section that shows live records but stays editableBindingSourceData-bound sections
A box on the admin dashboardDashboard::admin()->row()->widget()Dashboard
A sidebar/footer widgetArrilot widget + Widgets::register()Widgets
A new public page type (like "Shop page")AppPages::register() and/or a resolvable slugPage types
A new payment methodGateway module on TruPaymentsPayments
A new public lookTheme extending defaultThemes