The services a plugin registers into. Each is a singleton bound by a core provider and rebuilt on every request, so register into them on every request that needs them.
Facade (App\Facades\…) | Container key | Class | Register from |
|---|---|---|---|
MenuManager | menumanager | App\Services\MenuManager | AdminBooting listener |
MenuBuilder | menubuildermanager | App\Services\MenuBuilderManager | AdminBooting listener |
SettingsManager | settingsmanager | App\Services\Settings\Settings | AdminBooting listener |
Dashboard | dashboard | App\Services\Dashboard\DashboardRegistry | boot() |
Shortcode | shortcodes | App\Services\PageBuilder\ShortcodeRegistry | boot() |
Widgets | SeoWidget | App\Services\WidgetManager | boot() |
AppPages | app-pages | App\Services\AppPages\PageRegistry | boot() |
Roles | rolesmanager | App\Services\RoleManager | Core only (team roles) |
UniqueSlugFacade | uniqueslug | App\Helpers\Classes\UniqueSlug | — (a helper) |
Agent | agent | Detection\MobileDetect (device detection) | — |
Meta | — | Head tags; TruCMS macros setMeta(), setFont() | Controllers |
| — | BindingSourceRegistry::class | App\Services\PageBuilder\Bindings\BindingSourceRegistry | boot() |
| — | PageBuilderAssetRegistry::class (per request) | App\Services\PageBuilder\Assets\PageBuilderAssetRegistry | Render time |
| — | ThemeOptionStore::class, ThemeOptionsSchema::class, ThemeCssCompiler::class | App\Services\Themes\… | — |
The admin sidebar. Items are App\Services\Menu\MenuItems. Guide: Admin menu and dashboard.
| Method | Purpose |
|---|---|
make(string $key, callable $callable, ?int $order = null): self | Create or replace an entry; the callable receives a MenuItems |
get(string $key): ?MenuItems, has(string $key): bool | Read an entry (add sub-menus to it) |
remove(string $key): self, clear(): self | Delete entries |
all(bool $admin = true), adminMenus(), frontMenus(), count() | Read the sorted collection |
Sources an editor can drag into a menu in Appearance → Menus. Guide: Menus and navigation.
| Method | Purpose |
|---|---|
register(string $key, callable $callable, ?int $order = null): self | Add a container; the callable receives a MenuContainer |
get(string $key): ?MenuContainer, find(string $menu): bool, all() | Read containers |
Settings sections, pages and fields. Guide: Settings screens.
| Method | Purpose |
|---|---|
add(array $data): self | Register a section (id, title, link, pages). Re-using an id appends pages to that section |
section(string $key): Section|false | Read a registered section |
all(): Collection | All sections |
Named dashboards made of rows and items. Guide: The dashboard.
| Method | Purpose |
|---|---|
admin(), user(), for(?string $name) | The admin home, the visitor account dashboard, or any named dashboard (a DashboardDefinition) |
->row($name, $order, $class, $permission) | Create or fetch a row |
->widget(), ->include(), ->component(), ->html() | Add an item to the row |
rows(?string $name) | Read rows |
removeRow($dashboard, $row), removeItem($dashboard, $row, $item), removeDashboard($name), clear() | Take things away |
Render a dashboard in Blade with @dashboard('name'). Constants: DashboardRegistry::DEFAULT_DASHBOARD (admin.dashboard) and USER_DASHBOARD (user.dashboard).
Page-builder blocks. Guide: Shortcodes.
| Method | Purpose |
|---|---|
register(string $class), registerIfMissing(string $class) | Register a class that implements ShortcodeContract. register() throws on a duplicate id |
replace(string $class) | Replace an existing definition with yours |
category(string $id, string $label, int $priority = 100), group(string $shortcodeId, string $category) | Register a block-panel category, or move a shortcode into one |
has($id), get($id), handler($id), all(), grouped(), categories(), definitionForTag($tag) | Read the registry |
registerMarker(string $marker, array $assets, ?string $id = null) | Load assets on pages whose content contains a marker string |
registerContentAssets(string $content) | Queue the assets of every shortcode found in a piece of content (the page renderer calls it) |
Front-end widgets for widget areas. Guide: Widgets and widget areas.
| Method | Purpose |
|---|---|
register(string $key, string $widget): string | Make a widget class selectable |
get(string $key): ?string, find(string $widget): bool, all(): Collection | Read the registry |
Named page types an administrator maps to a CMS page. Guide: Page types and public URLs.
| Method | Purpose |
|---|---|
register(PageDefinition|Closure $definition), registerMany(iterable $definitions) | Add page types (build them with PageDefinition::make($key); a closure is called immediately and must return one) |
selectedPage(string $key): ?Page, selectedPageUrl(string $key): ?string | The page the site chose for a type, and its URL |
forPage(Page $page), firstForPage(Page $page) | Which types a given page serves |
has(), get(), forget(), definitions(), all() | Read and edit the registry |
Data-bound section sources. Resolve with app(BindingSourceRegistry::class). Guide: Data-bound sections.
| Method | Purpose |
|---|---|
register(BindingSource $source), registerIfMissing(BindingSource $source) | Add a source instance |
has($key), get($key), all(?array $keys), editorPayload() | Read the registry |
Collects the scripts and styles that page-builder content needs during one request; the layout prints them. You rarely call it directly: declare assets on your shortcode definition instead.
| Method | Purpose |
|---|---|
registerVite(string|array $entries, string $bundle = 'application', int $priority = 100) | Queue Vite entries |
registerStyle(string $url, ...), registerScript(string $url, ...) | Queue plain URLs |
render(string $placement), hasAssets(), reset() | Output and housekeeping |
php — in a public controller
use App\Facades\Meta;
Meta::setMeta($testimonial); // title, description, canonical, Open Graph, Twitter Card
Meta::setTitle(__('testimonials::testimonials.menu'));
Meta::setDescription($summary);setMeta($model) reads meta_title/title, meta_description and an og-image media collection when the model has them.
| Class | Use |
|---|---|
App\Services\ResponseCache\ResponseCacheInvalidator | flush(), flushWhenChanged(array $models). See Caching |
App\Services\ResponseCache\CacheProfile | keepOutOfCache(), GUESTS_ONLY |
App\Services\Slugs\SlugManager, SlugResolver | The global slug registry behind HasSlug |
App\Services\Authenticator | Two-factor checks used by both 2FA middlewares |
App\Services\GeoLocationService | IP to location (used for billing zones) |
Modules\TruPayments\Services\PaymentManager, GatewaySettings | Payments; see Payments and gateways |
Nwidart\Modules\Facades\Module | isEnabled(), find(), plus TruCMS macros requirements(), requiredBy(), withRequirements(), withPayment(), paymentModules() |