cboxdk / laravel-console-kit
Extension hooks for a Cbox admin console — nav areas, feature gates, UI slots, dashboard cards and per-tenant branding that an optional package registers into via composer, with zero host edits. The plugin pattern behind billing and other drop-in modules.
Requires
- php: ^8.4
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- illuminate/view: ^12.0 || ^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3.5 || ^4.0
README
cboxdk/laravel-console-kit — the extension hooks a Cbox admin console exposes so an
optional package can composer require in and light up a whole feature — nav, UI and
gates — with zero edits to the host app. It's the plug socket; a feature package
(billing, and others) is the plug.
The same kit is adopted by every console (cbox-id, ai-assistant, cortex, …), so one plugin works across all of them.
The four hooks
use Cbox\Console\Kit\Facades\Console; // 1. Nav — add an area, or add pages to a host area. Gate a page on a feature. Console::nav()->area('billing', 'Billing', 'card', order: 90) ->page('billing.plan', 'Plan', feature: 'billing') ->page('billing.invoices', 'Invoices', feature: 'billing'); // 2. Features — deny-by-default; a live resolver decides if it's on. Console::features()->register('billing', fn () => app()->bound(BillingManagement::class)); // 3. Slots — inject content into an EXISTING page. Console::slots()->add('settings.sections', 'billing::settings-card'); // 4. Dashboard cards — sugar over the well-known dashboard slot. Console::dashboardCard('billing::plan-card', order: 10);
Host side
Adopt the kit in your console shell — seed your defaults, render the registry:
{{-- nav --}} @foreach (\Cbox\Console\Kit\Facades\Console::nav()->areas() as $area) {{-- render $area->label / $area->icon; for each $area->pages() show it unless $page->feature and ! Console::featureActive($page->feature) --}} @endforeach {{-- slots --}} @consoleSlot('console.dashboard.cards') @consoleSlot('settings.sections')
Gate a plugin's routes so they don't even exist when its feature is off:
Route::middleware('console.feature:billing')->group(fn () => /* billing routes */);
Why a separate package
The hook contracts must be reusable across consoles, so they can't live inside any one app or inside the billing plugin. This package is just the shared socket — no feature logic, no UI of its own. Deny-by-default throughout: an unregistered feature is off, a gated page is hidden, a guarded route 404s.
License
MIT © Cbox.