Who this is for
You are extending Pionia Shop beyond inline Application\ code — publishing a reusable Composer package, registering an AppProvider for middleware and routes, or looking up global helpers like response() and table().
What you will learn
- The difference between plain plugins (libraries) and providers (boot hooks)
- Where to register an
AppProviderinsettings.iniorbootstrap/application.php - Which guide covers Packagist publishing vs hook reference vs helper index
Before you start
Before you start
- Working Pionia app (
composer create-project pionia/pionia-appor Pionia Shop from the API tutorial) - Familiarity with Services and
[app_switches]insettings.ini
How it works
Most teams extend Pionia in two ways:
- Application code — services, switches, middleware under
Application\in your repo. - Composer packages — reusable libraries; some packages also ship a provider to register middleware, routes, or commands automatically.
flowchart LR App[Pionia Shop app] --> Code[Application services] App --> Pkg[Composer package] Pkg --> Plugin[Plain plugin class] Pkg --> Prov[Provider subclass] Prov --> Boot[middlewares routes commands] App --> AP[AppProvider in settings.ini] AP --> Boot
| Guide | Audience |
|---|---|
| Composer packages | Package authors (plugins + providers) |
| App providers | Provider hook reference and registration |
| Helpers | Global shortcuts (response(), table(), logger()) |
| Maintainer notes | PioniaCore contributors only |
Start with Composer packages if you are publishing to Packagist. Use App providers when you need the full hook list and boot order.
Common mistakes
- Putting boot-time wiring in a service action instead of an
AppProvider— helpers likelogger()are not available beforeAppRealm::create()returns - Using a generic API version slug (
v2) in a packageroutes()— collides with the host app’s switches - Forgetting
php pionia cache:clearafter removing a provider from[app_providers] - Requiring RoadRunner or Redis in package
requireinstead ofsuggest— breaks minimal installs
What’s next
Composer packages
Ship plugins and providers on Packagist.
App providers
Full hook list and boot order.
Helpers
response(), table(), logger(), and more.