Search by

vm-engine / webms

adods

Standalone Livewire CMS for Laravel: pages, sections and articles, galleries, downloads, menus, translations, per-item access control, search, feeds, sitemap and analytics

Package info

github.com/vm-engine/webms

pkg:composer/vm-engine/webms

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.1 2026-12-04 07:19 UTC

This package is auto-updated.

Last update: 2026-12-04 14:59:30 UTC


README

A standalone website CMS for Laravel + Livewire: pages, article sections and categories, tags, photo albums and banners, downloads, menus, media galleries, custom fields, multi-language content, site search, RSS feeds, a sitemap, Google Analytics / Search Console and per-item access control, with a full admin and public viewers.

It needs nothing but Laravel and Livewire. It ships its own prebuilt CSS, JS, icon font and a self-hosted Jodit editor (no build step in your app, no Tailwind or Flux requirement). vm-engine/file-manager is optional: with it, file fields and the editor browse your file manager; without it, they are plain uploads.

Contents

  1. Features
  2. Requirements
  3. Installation
  4. Configuration
  5. Abilities (permissions)
  6. Access lists and principals
  7. Routing and languages
  8. The admin
  9. The public site
  10. Widgets
  11. Page Builder
  12. Editor and file fields
  13. Content features
  14. Search, sitemap and feeds
  15. Google Analytics and Search Console
  16. Content Security Policy
  17. Activity events
  18. Commands and scheduling
  19. Models, services and enums
  20. Customising views and translations
  21. Rebuilding the assets
  22. Testing the package
  23. Credits and licenses

Features

  • Pages: a three-level page tree with drag-and-drop sibling ordering, a sub-menu, child cards or a one-page layout, scheduled publishing.
  • Articles: sections, categories and tags, featured articles, scheduled and expiring publishing, reading time.
  • Page Builder: standalone pages composed from the widgets on a live canvas: drag widgets between template regions, style them from a curated Tailwind class palette, publish when ready (details).
  • Galleries: normal albums (with a lightbox) and banner albums (a carousel widget).
  • Downloads: categories of files, streamed through WebMS and protected by the same access lists as other content.
  • Menus: any number of positions, three levels, eight target types.
  • Media galleries: inline image galleries dropped into rich text with a [gallery:key] tag.
  • Custom variables and custom fields: free key/value variables, and typed fields (text, number, date, select, checkboxes…) that can be searched, filtered and sorted on the public listings.
  • Multi-language: every content type is translatable; locale-prefixed URLs, hreflang, a language switcher.
  • Search: a database (or Laravel Scout) index, a search page, a live-suggest search box, popular terms.
  • Access control: per-item visibility (public, logged in, or named users/roles) and per-item managers, on top of Gate abilities.
  • SEO: a multi-language sitemap, RSS feeds, meta titles/descriptions and Open Graph images.
  • Analytics: GA4 tracking with Consent Mode v2 and a cookie banner, Search Console verification, and an admin dashboard fed by the Google APIs.
  • Custom rendering: override the view or layout of any item, with cascading defaults.
  • Security: a Content Security Policy with nonces, HTML sanitising of rich text, signed delete tokens.

Requirements

  • PHP 8.5+
  • Laravel 13
  • Livewire 4
  • livewire/flux ^2 and vm-engine/ui-kit ^0.2: the admin is built on them. Your app's Tailwind build must scan webms: add @source '../../vendor/vm-engine/webms/resources/views'; and @source '../../vendor/vm-engine/webms/src'; to resources/css/app.css.
  • mews/purifier (installed automatically)

Optional:

  • vm-engine/file-manager ^0.1: the file picker in file fields and the editor.
  • spatie/laravel-permission: name roles in access lists.
  • laravel/scout: use a Scout engine for search.
  • The intl PHP extension: native language names in the switcher.

Installation

composer require vm-engine/webms
php artisan vendor:publish --tag=webms-config
php artisan migrate
php artisan storage:link
php artisan webms:search-reindex   # registers the search page and builds the index

That's it: no setup command, no frontend build. Package assets are served from /webms-assets/….

Then:

  1. Define the abilities (next sections). Until a user passes webms.access, the admin answers 403.
  2. Make sure your app has a login route; the admin uses the auth middleware.
  3. Add Sitemap: https://your-site/sitemap.xml to public/robots.txt.
  4. Open /admin/cms.

WebMS's catch-all is registered with Route::fallback(), so every route your app defines always wins over CMS content.

Configuration

Everything lives in config/webms.php.

Key Default Meaning
multi_language env('WEBMS_MULTI_LANGUAGE', false) Locale-prefixed public URLs (/en/about, /id/about)
locales ['en'] Enabled content locales
primary_locale null (= app.locale) Language of the base content columns. Never change it once content exists
language_names [] Per-locale display-name overrides, e.g. ['id' => 'Bahasa Indonesia']
language_icons [] Per-locale icon: image path/URL, CSS class or emoji
route_cache_ttl 60 Seconds a public path lookup is cached; 0 disables caching
sitemap.static_paths ['/'] Extra paths listed in the sitemap
search.engine database database (LIKE) or scout
search.scout_content_limit 5000 Body characters sent to the Scout engine
search.slug search Search page path; run webms:search-reindex after changing it
search.per_page 10 Results per page
search.rate_limit / search.suggest_rate_limit 30 / 120 Searches / suggestions per minute per IP
search.popular_min_hits / search.popular_limit 3 / 8 Popular-term threshold and list size
analytics.fake false Dummy Google data for the dashboard (ignored in production and tests)
principals users Who access lists can name: users, spatie or a class name (details)
file_manager auto auto uses vm-engine/file-manager when installed; true/false force it
uploads.disk / uploads.path public / webms/uploads Where uploads go when file-manager is not used
uploads.max_kb 10240 Upload size limit
uploads.allowed_extensions images, office, pdf, zip, mp4 Allowed upload extensions
editor.height 400 Default editor height (px)
assets_prefix webms-assets URL prefix of the package asset route
admin.enabled true Register the admin routes
admin.prefix admin/cms Admin URL prefix
admin.middleware ['web', 'auth'] Admin middleware (WebMS adds the ability check)
admin.ability webms.access Ability required for any admin page
admin.layout webms::layouts.admin Admin layout view (custom layouts)
frontend.layout webms::layouts.frontend Default public layout (contract)
frontend.download_prefix webms-download URL prefix of download streams
builder.templates [] Extra Page Builder templates, merged over the package ones (details)
csp.* see CSP Content Security Policy

Abilities (permissions)

WebMS checks Laravel Gate abilities and defines none itself, so you decide who holds what. All of them are listed in VmEngine\WebMS\Support\Abilities::ALL:

Ability Controls
webms.access Entering the admin at all (admin.ability)
webms.access.bypass "Developer" rights: custom field schemas, media-gallery switches, root pages, the child-page lock, and every item regardless of its access list
webms.access.update Editing an item's Access panel (on items the user can manage)
webms.page.{create,read,update,delete} Pages
webms.page.publish.{read,update} Publishing pages
webms.builder.{create,read,update,delete} Page Builder pages (settings and layout)
webms.builder.publish.{read,update} Publishing Page Builder pages
webms.article.{create,read,update,delete} Articles
webms.article.publish.{read,update} Publishing articles
webms.article.section.{create,read,update,delete} Sections
webms.article.category.{create,read,update,delete} Categories
webms.gallery.album.{create,read,update,delete} Normal albums
webms.gallery.banner.{create,read,update,delete} Banner albums
webms.gallery.image.{create,read,update,delete} Album images
webms.menu.{create,read,update,delete} Menus and menu items
webms.tag.{create,read,update,delete} Tags
webms.download.category.{create,read,update,delete} Download categories
webms.download.file.{create,read,update,delete} Download files
webms.analytics.{read,update} Analytics dashboard (update = Refresh)
webms.settings.{read,update} CMS settings (tracking, Google API)
webms.search_term.{read,update,delete} Popular search terms

A super-admin is one Gate::before:

// AppServiceProvider::boot()
Gate::before(fn (User $user) => $user->is_admin ? true : null);

Granular, e.g. with spatie/laravel-permission (permissions named like the abilities), or by hand:

Gate::define('webms.access', fn (User $user) => $user->hasRole('editor'));
Gate::define('webms.article.update', fn (User $user) => $user->hasRole('editor'));

In your own views, @webmsCan('webms.page.read|webms.article.read') … @endwebmsCan passes when the user holds any listed ability; webms.gallery.any means any ability under that prefix. Routes can use the webms.can:a,b middleware the same way. @webmsDev … @endwebmsDev shows content to webms.access.bypass holders.

Access lists and principals

Each page, section, category, article, album and download has an Access panel: visibility (inherit, public, logged-in users, or named principals) and a list of managers. Lists inherit down the tree. Abilities still apply: an access list narrows what an ability grants, it never widens it.

Who can be named is set by principals:

  • users (default): users of your auth.providers.users.model, searched by name and email.
  • spatie: users plus spatie/laravel-permission roles (the user model must use HasRoles).
  • A class implementing VmEngine\WebMS\Contracts\PrincipalResolver:
use Illuminate\Contracts\Auth\Authenticatable;
use VmEngine\WebMS\Contracts\PrincipalResolver;

class TeamPrincipals implements PrincipalResolver
{
    /** Keys the user answers to, e.g. ['user:5', 'team:2']. */
    public function keysFor(Authenticatable $user): array
    {
        return ['user:'.$user->getAuthIdentifier(), 'team:'.$user->team_id];
    }

    /** @return list<array{value: string, label: string}> */
    public function search(string $query, int $limit = 10): array
    {
        return Team::where('name', 'like', "%{$query}%")->limit($limit)->get()
            ->map(fn (Team $team) => ['value' => 'team:'.$team->id, 'label' => 'Team: '.$team->name])
            ->all();
    }

    /** @return list<array{value: string, label: string}> */
    public function load(array $keys): array
    {
        // labels for stored keys (shown when editing an access list)
    }
}
// config/webms.php
'principals' => App\Cms\TeamPrincipals::class,

Routing and languages

Content URLs live in WebMS's own route registry (webms_routes), kept in sync by model observers: create, rename, move or delete an item and its URLs follow. A Route::fallback() looks a path up in the registry and renders the matching viewer, so your app's own routes always take precedence. Unknown paths are 404s.

Content URL
Page /{parent}/{child}/{slug}
Section /{section}
Category /{section}/{category}
Article /{section}/{article} or /{section}/{category}/{article}
Gallery index /gallery (the slug comes from the menu item that links to it)
Album /gallery/{album}
Download category /{download}
Search /search (search.slug)

The registry is also usable directly:

use VmEngine\WebMS\Facades\Routes;

Routes::register('promo', 'webms::frontend.page-viewer', ['page_id' => 12]);
Routes::forget('promo');
Routes::url('about');   // locale-aware URL

Multi-language (multi_language = true, two or more locales):

  • / redirects to /{primary_locale}, and /{locale} serves the home route in that language.
  • An unprefixed content path redirects (301) to its prefixed form; admin paths are never redirected.
  • Slugs are shared between languages; text is translated.
  • Run php artisan route:clear after toggling multi-language if routes are cached (feeds register per-locale routes).

Links and the language switcher

In custom templates, never hand-build href="/{{ $x->slug }}". Use \VmEngine\WebMS\Support\CmsUrl::to($model) (root-relative, locale-prefixed: /id/news/ai) or CmsUrl::to('some/path'); CmsUrl::absolute($path, $locale) gives full URLs.

<head>
    <x-webms::hreflang />   {{-- <link rel="alternate" hreflang="…"> + x-default --}}
</head>
<header>
    <x-webms::language-switcher />
</header>
Prop Values Default
variant dropdown (native <details>, no JS) · list dropdown
display name · code · both · icon · icon-name · icon-code name
trigger current · globe current
globe-icon CSS class for the globe trigger ph ph-globe
hide-current omit the active language false
wrapper-class extra classes on the root none
template + :with your own view; receives $languages (code, name, url, absolute, active, icon), $current, $display + $with none

Markup is unstyled BEM (webms-language-switcher, __current, __list, __item, __item--active, __link, __icon, __name, __code). The switcher and hreflang render nothing when multi-language is off or only one language is enabled.

Icons: a language_icons entry may be an image (/storage/flags/id.svg, an http(s):// URL, data:image/…), a CSS class (fi fi-id) or an emoji. Without one, a flag emoji is derived from the locale. Windows doesn't render flag emoji, so use images or a flag CSS class in production.

The admin

The admin lives under admin.prefix (/admin/cms), behind admin.middleware plus webms.can:{admin.ability}. Route names are webms.admin.* (webms.admin.page.index, webms.admin.article.form, …). Its sidebar shows only the sections the user can read.

Using your own admin layout: set admin.layout to your view. It must:

  • render {{ $slot }} and use $title if you want the page title
  • load your app's Vite assets (Flux + Tailwind), @fluxAppearance / @fluxScripts, and webms-admin.js (plus sortable/Sortable.min.js for drag-and-drop ordering) before @livewireScripts
  • include <x-ui::toastr /> and <x-ui::confirm-dialog /> once, outside any Livewire component
<flux:sidebar sticky collapsible="mobile">
    <flux:sidebar.nav>
        <x-webms::admin-sidebar />   {{-- optional: a flux:sidebar.group of the WebMS nav, filtered by ability --}}
    </flux:sidebar.nav>
</flux:sidebar>
<flux:main container>{{ $slot }}</flux:main>
<x-ui::toastr />
<x-ui::confirm-dialog />
{{-- Sortable + webms-admin.js, with data-navigate-once so they register once across wire:navigate --}}
<x-webms::admin-scripts />
@livewireScripts
@fluxScripts

Notifications use ui-kit's ui-notify event; the admin no longer loads webms-admin.css or Phosphor (Phosphor stays for the public layout).

To link the CMS from your own nav, VmEngine\WebMS\Support\AdminNav::visible() returns the items (label, url, icon, active) the current user may see. icon is a Heroicon name for <flux:sidebar.item>.

The public site

Viewers render inside frontend.layout (or an item's custom layout). The default layout is a bare HTML shell; most sites point frontend.layout at their own. A layout receives $slot, $title, $description and (on items that have one) $ogImage, and should include:

<head>
    <title>{{ $title ?? config('app.name') }}</title>
    <x-webms::analytics-head />   {{-- GA4 + Search Console verification --}}
    <x-webms::hreflang />
    <x-webms::feed-links />       {{-- RSS autodiscovery --}}
    <link rel="stylesheet" href="{{ \VmEngine\WebMS\Http\Controllers\AssetController::url('phosphor.css') }}">
    <link rel="stylesheet" href="{{ \VmEngine\WebMS\Http\Controllers\AssetController::url('webms-frontend.css') }}">
    <script nonce="{{ csp_nonce() }}" src="{{ \VmEngine\WebMS\Http\Controllers\AssetController::url('webms-frontend.js') }}" defer></script>
    @livewireStyles
</head>
<body>
    <x-webms::menu position="header" />
    <livewire:webms::frontend.search-box />
    {{ $slot }}
    <x-webms::cookie-settings-link />
    <x-webms::cookie-consent />
    @livewireScripts
</body>

webms-frontend.css contains Tailwind's theme and utilities plus the CMS component styles, without Tailwind's preflight, so your site's base styles stay untouched. Component markup is BEM under webms-* (webms-article-card, webms-section__title, …) if you'd rather style it yourself.

Viewers (resolved by the router; you don't place them): webms::frontend.page-viewer, section-list, category-list, article-viewer, gallery-list, album-viewer, download-list, download-viewer, search-results.

Menus

<x-webms::menu position="header" />
<x-webms::menu position="header" template="partials.main-nav" :with="['activeClass' => 'is-active']" />

Positions are free strings chosen when creating a menu. Up to three levels render as BEM markup; template receives $items, $position + $with.

target_type URL
url the custom link
page /{page full slug}
section /{section}
category /{section}/{category}
article /{section}/{article} or /{section}/{category}/{article}
album /gallery/{album}
album_image /gallery/{album}#image-{id}
album_list /{target_url ?: 'gallery'} (the gallery index)

Widgets

Blade components for any view. Data is fetched on render. Several accept template (replace the markup with your view; it receives the widget's data + with), card (replace only the per-item markup), wrapperClass / gridClass, and bare (drop the wrapper <div>s).

<x-webms::widget.page slug="about" :showTitle="true" :showCover="true" template="widgets.page" />

<x-webms::widget.page-children slug="services" layout="grid" :limit="12" :showExcerpt="true" :recursive="false" />

<x-webms::widget.articles sort="latest" :limit="6" layout="grid" :showSection="true" :showDate="true" :showFeaturedBadge="true" />
{{-- sort: latest | oldest | featured | az | za --}}

<x-webms::widget.section-articles section="news" :limit="6" card="widgets.article-card" template="widgets.news" />

<x-webms::widget.category-articles section="news" category="tech" :limit="6" />

<x-webms::widget.tag-articles tags="php,laravel" match="any" :limit="6" />   {{-- match: any | all --}}

<x-webms::widget.banner-slider album="hero" :autoplay="true" :interval="5000" height="480px" />

<x-webms::widget.gallery album="team-photos" :limit="0" :showCaption="true" :showAlbumTitle="false" />
{{-- showTitle: per-image titles; showAlbumTitle: the album name as a linked heading above the grid --}}

Custom templates must call $model->translate('title') (not $model->title) to show translations.

Page Builder

Admin → Page Builder (right after Pages) creates standalone public pages built from the widgets. A builder page has its own URL (/{slug}, registered in the route registry when published), SEO fields and translatable title/meta, but no rich-text body: its content is the widgets.

Editing. Add (or the pencil) opens the settings form: title, URL, template, SEO. Open Builder opens the editor:

  • The canvas is an iframe that renders the draft with the real frontend layout, template and widgets; the reload button reloads it.
  • Hover a widget for its toolbar: drag handle (move within or across regions), settings, duplicate, remove (asks for confirmation).
  • + Add widget in a region opens the widget picker; the new widget's settings open in the drawer.
  • Style on a region, or the classes in a widget's drawer, apply palette classes.
  • The device buttons narrow the canvas to tablet/mobile width; Preview opens the draft without edit chrome.
  • Edits only change the draft (layout_draft). Publish (webms.builder.publish.update) copies it to the live layout; the list and editor flag "Unpublished changes" until then.

Widgets. The eight widgets, configured from a per-widget prop schema in VmEngine\WebMS\Support\CmsWidgetRegistry (limit, sort, layout, show toggles, and searchable pickers for the page/section/category/album/banner). Every widget also has a Heading with a Show heading switch, printed as <h2 class="webms-widget__heading webms-builder-widget__heading"> above it (plain text, at most 120 characters). The widgets' template/card/with/bare/wrapper-class props are not exposed: style through the palette. A widget that throws is logged and skipped on the public page, and shown as an error card on the canvas.

Templates and regions. A template is a Blade view plus its named regions. The package ships full (hero, main) and sidebar-right (hero, main, sidebar, footer-top). Add or override templates in config/webms.php:

'builder' => [
    'templates' => [
        'landing' => [
            'name' => 'Landing',
            'view' => 'builder.landing',
            'regions' => ['hero' => 'Hero', 'features' => 'Features', 'main' => 'Main'],
        ],
    ],
],

The view receives $layout, $regions and $editing and places each region:

<div class="space-y-12">
    <x-webms::builder.region name="hero" :$layout :$regions :$editing />
    <div class="grid gap-8 lg:grid-cols-2">
        <x-webms::builder.region name="features" :$layout :$regions :$editing />
        <x-webms::builder.region name="main" :$layout :$regions :$editing />
    </div>
</div>

Entries whose view doesn't exist or that declare no regions are ignored; a page whose template disappears renders with full. Switching a page's template moves widgets from regions the new template lacks into its first region.

Class palette. Editors pick from resources/builder/class-palette.json (spacing, background, text, border and shadow, width, responsive visibility); anything outside the palette is dropped on save. The palette ships compiled in webms-frontend.css, so there is no build step. If your site uses its own layout and Tailwind build instead of loading that file, add the palette to your CSS entry:

@source '../../vendor/vm-engine/webms/resources/builder/class-palette.json';
  • Full width: the Width group's mx-[calc(50%-50vw)] stretches a region past the page container to the viewport edges (pair it with px-* padding). The canvas and public page wrappers clip the resulting overflow ([html:has(&)]:overflow-x-clip [body:has(&)]:overflow-x-clip), so no horizontal scrollbar appears. Meant for full-span regions; inside the sidebar template's grid it overflows.
  • Custom classes: a free-text field per widget and region for semantic class names styled by your own CSS (e.g. hero-banner). Only plain class names are kept (Tailwind syntax such as md: or w-1/2 is dropped, since it would never be compiled), at most 20.

Menus and sitemap. Menu items can target a published builder page (Builder Page type); published builder pages are listed in /sitemap.xml.

Editor and file fields

Rich text uses Jodit 4, self-hosted (<x-webms::rte> / <x-webms::ui.rte>). Saved HTML is sanitised with HTMLPurifier (profile purifier.settings.webms_rte, from config/webms-purifier.php). php artisan webms:sanitize-content re-sanitises stored content.

With vm-engine/file-manager (file_manager = auto and installed, or true):

  • the editor's image/file/video buttons open the file-manager picker
  • file fields (cover images, Open Graph images, album images, download files, media galleries) use the picker; uploads follow file-manager's own folders and permissions

Without it:

  • the editor's image/file buttons upload to POST {admin.prefix}/editor/upload (route webms.admin.editor.upload)
  • file fields show a native upload input
  • both store on uploads.disk under uploads.path/Y/m, validated against uploads.max_kb and uploads.allowed_extensions

Either way, files attached to albums, downloads and media galleries are recorded in WebMS's own webms_files table (file-manager files are referenced, not copied), so the content keeps working if you switch modes later.

The field component is reusable in your own Livewire forms:

<livewire:webms::file-field wire:model="form.image" :label="__('Image')" accept="image/*" />

It binds the file's URL. With :record="true" it also dispatches webms:file-selected { url, fileId, key } (a WebmsFile id).

Content features

Custom variables

Every content type has key/value variables in its config JSON. Users with the item's update ability define the schema (key, label, whether others may edit it, and whether new pairs may be added); others fill in values. Read them with $model->config['vars'] ?? [].

Custom fields

Typed fields defined by a developer (webms.access.bypass) on a container and filled in by any editor:

Defined on Values on
Root page the root page and all its descendants
Section the section and its articles
Download category the category and its files
Album the album and its images
  • Types: text, textarea, number, email, url, date, datetime, select, radio, checkbox, checkboxes.
  • Definition: name, label, type, options, default, required, help text, and searchable / filterable / sortable flags.
  • Translatable labels: a label, help text or option label starting with __ is a translation key (__webms::labels.price).
  • Per-locale values: a missing locale falls back to the primary locale, then the default. required applies to the primary locale only.
  • Type lock: a field's type can't change once it has values; renaming keeps them; deleting a field deletes its values.
$article->field('price');            // current locale
$article->field('price', 'id');
$article->fields();                  // ['price' => 12.5, 'tags' => ['a', 'b'], ...]

CmsArticle::whereField('price', '<', 100)->orderByField('event_date', 'desc')->get();
CmsArticle::whereFieldIn('tags', ['a', 'b'])->get();

Searchable values go into the search index. The section, category, album, download and page-children listings accept ?f[name]=value, ?f[name][min]=…&f[name][max]=…, ?f[name][]=a and ?sort=name&dir=asc|desc for filterable/sortable fields; the default views render <x-webms::field-filters :filter="$fieldFilter" /> (custom views receive $fieldFilter too).

Media galleries

Small image galleries inside rich text.

  • Enable (developers): Enable media galleries on a root page (covers its subtree), a section (its articles) or a download (its files).
  • Manage: saved pages, articles and download files show a Media Galleries panel. Each gallery has a title, a key, a layout (slider or grid) and images with per-locale captions. Paste its tag, e.g. [gallery:intro-shots], into the body; a tag alone in a paragraph replaces the <p>.
  • Render: {!! $page->renderWithMediaGalleries('body') !!} (download files: description). Unknown keys and disabled features render nothing. CmsMediaGalleryRenderer::strip($html) removes tags for plain-text output.
  • Cleanup: deleting a section or download removes its articles/files by FK cascade, which leaves their galleries behind; php artisan webms:prune-media-galleries (--dry-run first) deletes those.
  • Theme: publish and override webms::livewire.frontend.partials._media-gallery-slider / _media-gallery-grid.

Page display options

Setting config key Default Notes
Show excerpt on the page show_excerpt off
Child pages as a sub-menu show_submenu off Sidebar on desktop, stacked on mobile
Child pages display children_display none none, cards (grid + field filters) or one_page (children rendered as sections; sub-menu links become anchors)
Allow non-developers to add child pages allow_child_create on Developers only. $page->acceptsChildrenFromCurrentUser()

Sibling pages are reordered by dragging the grip handle in the page list; a page can only move among its siblings, so URLs never change.

Article display options

Set on the section, overridable per article: show_date (on), show_excerpt (on); and per section items_per_page (12). Templates should call $article->showsDate() / $article->showsExcerpt().

Custom views and layouts

Every item has custom_view / custom_layout (the Custom Rendering card). Sections and categories add custom_category_view / custom_article_view for their content. resolveCustomView() / resolveCustomLayout() walk the cascade:

Model View falls back through Layout falls back through
CmsPage own → parent pages own → parent pages
CmsCategory own → section's custom_category_view own → section's custom_layout
CmsArticle own → category's custom_article_view → section's custom_article_view own → category → section
others own only own only

A name only counts if the view exists; otherwise the next level applies, then frontend.layout. Your own viewers can use the same helper:

use VmEngine\WebMS\Support\FrontendViewResolver;

$view = FrontendViewResolver::view($page->resolveCustomView(), 'webms::livewire.frontend.page-viewer.page-viewer');
$layout = FrontendViewResolver::layout($page->resolveCustomLayout());

Search, sitemap and feeds

Piece Usage
Search page /{locale}/search?q=…, registered by php artisan webms:search-reindex
Search box <livewire:webms::frontend.search-box />: a plain GET form with live suggestions, popular searches, keyboard navigation and ARIA combobox semantics
Admin Search Terms: hide, unhide or delete popular terms
Index webms_searchables, kept in sync automatically; rebuild with php artisan webms:search-reindex --type=page --type=article
PHP app(CmsSearchService::class)->search($q, $types, $perPage), ->suggest($q)

Sitemap: /sitemap.xml (route webms.sitemap) lists every visible item, with hreflang alternates when multi-language is on, plus sitemap.static_paths.

Feeds (only content a guest can see, 20 items, application/rss+xml):

Feed URL
Articles /feed/articles.xml
One section /feed/articles/{section}.xml
Downloads /feed/downloads.xml
Gallery /feed/gallery.xml

With multi-language on, /{locale}/feed/… serves translated feeds. <x-webms::feed-links /> adds autodiscovery links (plus the current section's feed on section, category and article pages).

Google Analytics and Search Console

Configured in the admin under Settings (webms.settings.*); stored in webms_settings, the service-account key encrypted with your app key.

  1. Tracking: a GA4 Measurement ID (G-…) and a Search Console verification token. <x-webms::analytics-head /> renders gtag.js only in production and never for users who pass admin.ability, and adds Google's hosts to the CSP on those pages.
  2. Cookie consent (Consent Mode v2): on by default. GA starts denied and <x-webms::cookie-consent /> asks the visitor; the choice is kept for 180 days and <x-webms::cookie-settings-link /> reopens the banner.
  3. Reporting API: enable the Google Analytics Data API and Google Search Console API in a Google Cloud project, create a service account with a JSON key, give its email Viewer access in GA4 and Search Console, then fill in the GA4 property ID (numeric), the Search Console property (https://example.com/ or sc-domain:example.com) and paste the key.
  4. Dashboard: {admin.prefix}/analytics (webms.analytics.read): users, sessions, views, engagement and top pages from GA4; clicks, impressions, CTR, position and top queries from Search Console, for 7/28/90 days. Results are cached for an hour; Refresh needs webms.analytics.update.
  5. Dummy data: set analytics.fake = true and fill any property IDs to see the dashboard without Google. Ignored in production and tests.

Content Security Policy

WebMS ports Synapse's SecureHeaders middleware: a per-request nonce (shared with Vite::useCspNonce()), default-src 'self', and the extra hosts you list.

'csp' => [
    'enabled' => true,
    'global' => false,          // true: send it on every `web` request
    'script_src' => ['https://cdn.example.com'],
    'style_src' => [], 'img_src' => [], 'font_src' => [],
    'connect_src' => [], 'frame_src' => [], 'media_src' => [],
],
  • With global = false the header is sent on WebMS admin and public routes only.
  • It is skipped in the local environment.
  • script-src includes 'unsafe-eval' unless livewire.csp_safe is true. All WebMS views work with Livewire's CSP-safe Alpine build, so set csp_safe to drop it.
  • Use nonce="{{ csp_nonce() }}" on your own inline and external <script> tags.
  • The demo seeder (VmEngine\WebMS\Database\Seeders\CmsDemoSeeder) uses picsum.photos cover images. To see them outside local, add 'https://picsum.photos' and 'https://fastly.picsum.photos' to csp.img_src. Keep the default empty in production.

Activity events

Every user-initiated write (create, update, delete, reorder, settings) dispatches VmEngine\WebMS\Events\WebmsActivity:

Event::listen(function (WebmsActivity $event) {
    // $event->userId, $event->action ("webms.page.12.update"),
    // $event->description, $event->subject ("page.12")
});

WebMS registers no listener; log it however you like.

Commands and scheduling

Command Purpose
webms:search-reindex {--type=*} Register the search page and rebuild the search index
webms:sanitize-content {--dry-run} Re-run HTMLPurifier over stored rich text
webms:prune-media-galleries {--dry-run} Delete galleries orphaned by cascaded deletes
// routes/console.php
Schedule::command('webms:prune-media-galleries')->weekly();

Publishing needs no scheduler: a published page or article with a future publish date appears on that date, and its expiry date hides it again; both are checked when content is read.

Models, services and enums

Model Table
CmsPage webms_pages
CmsBuilderPage webms_builder_pages (layout_draft is edited, layout is published)
CmsSection, CmsCategory, CmsArticle, CmsTag webms_sections, webms_categories, webms_articles, webms_tags (+ webms_article_tag)
CmsAlbum, CmsAlbumImage webms_albums, webms_album_images
CmsDownload, CmsDownloadFile webms_downloads, webms_download_files
CmsMenu, CmsMenuItem webms_menus, webms_menu_items
CmsMediaGallery, CmsMediaGalleryImage webms_media_galleries, webms_media_gallery_images
CmsField, CmsFieldValue webms_fields, webms_field_values
CmsTranslation, CmsSearchable, CmsSearchTerm, CmsAccessGrant webms_translations, webms_searchables, webms_search_terms, webms_access_grants
WebmsFile, WebmsRoute, WebmsSetting webms_files, webms_routes, webms_settings

All live in VmEngine\WebMS\Models. Enums (VmEngine\WebMS\Enums): ArticleStatus (Draft, Published, Scheduled), AlbumType (Normal, Banner), CmsVisibility (Public, Protected = logged in, Private = named principals, Inherit), CmsFieldType, AnalyticsRange.

Queries and writes go through services in VmEngine\WebMS\Services: CmsPageService, CmsArticleService (sections, categories, tags, articles), CmsGalleryService, CmsDownloadService, CmsMenuService (buildTree('header')), CmsSitemapService, CmsFeedService, CmsSearchService and CmsAccessService. Write methods log activity themselves.

$articles = app(CmsArticleService::class)
    ->getPublishedArticlesInSectionForWidget(sectionId: $section->id, sort: 'latest', limit: 6);

Customising views and translations

php artisan vendor:publish --tag=webms-views   # resources/views/vendor/webms
php artisan vendor:publish --tag=webms-lang    # lang/vendor/webms (en, id)

Prefer custom_view / custom_layout, widget template/card, and frontend.layout over publishing views: published views don't receive package updates.

Rebuilding the assets

resources/dist is committed, so apps never build anything. To change the package's CSS or JS:

npm install
npm run build   # Tailwind 4 → webms-admin.css / webms-frontend.css, then the JS bundles

Testing the package

From the package directory:

composer install
vendor/bin/phpstan analyse --memory-limit=1G
vendor/bin/pint
vendor/bin/pest --parallel

The suite runs on Orchestra Testbench with SQLite and foreign keys enforced, against both file-manager modes.

Credits and licenses

WebMS is MIT licensed. Bundled third-party assets (licenses alongside them in resources/dist):