ChargePanda Module System — Developer Handbook
ChargePanda's module system lets you extend the platform by dropping a self-contained folder into modules/. Your module can add database tables, admin pages, customer-facing pages, pricing models, feature gates, and event listeners — without modifying a single core file.
What you can build
| Capability | Helper / mechanism |
|---|---|
| Database tables | Migrations auto-loaded by the module loader |
| Admin pages + sidebar links | registerAdminMenuItem() |
| Admin settings tab | registerAdminSettingsLink() |
| Customer account pages + sidebar links | registerAccountMenuItem() |
| Public frontend pages | Routes + views inside the module |
| Custom pricing models | registerPricingModel() + JS handler |
| Feature gating by plan | PlanEntitlement + saas.feature middleware |
| React to platform events | boot() event listeners |
| Post-payment redirect | redirect_after_order session key |
| Artisan commands | $commands array on the service provider |
Versioning
Each section notes which version of the module system introduced the feature:
| Version | What was added |
|---|---|
| v1.0 | Module loader, module.json, AbstractModuleServiceProvider, module:make, admin UI |
| v1.0 | registerPricingModel(), registerFrontendScript(), JS pricing SDK |
| v1.0 | registerAdminMenuItem(), registerAdminSettingsLink(), PlanEntitlement, module events |
| v1.0 | Module frontend pages, SubscriptionActivated event, redirect_after_order hook |
| v1.0 | registerAccountMenuItem() with condition callable |
Table of contents
- Getting Started — Scaffold a module in under 5 minutes
- Module Structure — Directory layout,
module.json, service provider anatomy - Admin Integration — Sidebar links, settings tabs, admin pages
- Account Integration — Customer account sidebar and pages
- Frontend Pages — Public pages, two layout tracks, asset compilation
- Events & Hooks — Listening to platform events, post-payment redirect
- Pricing Models — Custom billing logic (PHP + JS)
- Plan Entitlements & Feature Gating — Limit features by plan
- Example Module — API Keys — Full walkthrough from scratch