Extending Pionia

Who this is for

You are extending DeskFlow 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 AppProvider in settings.ini or bootstrap/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-app or DeskFlow from the API tutorial)
  • Familiarity with Services and [app_switches] in settings.ini

How it works

Most teams extend Pionia in two ways:

  1. Application code — services, switches, middleware under Application\ in your repo.
  2. Composer packages — reusable libraries; some packages also ship a provider to register middleware, routes, or commands automatically.
flowchart LR App[DeskFlow 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
GuideAudience
Composer packagesPackage authors (plugins + providers)
App providersProvider hook reference and registration
HelpersGlobal shortcuts (response(), table(), logger())
Maintainer notesPioniaCore 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 like logger() are not available before AppRealm::create() returns
  • Using a generic API version slug (v2) in a package routes() — collides with the host app’s switches
  • Forgetting php pionia cache:clear after removing a provider from [app_providers]
  • Requiring RoadRunner or Redis in package require instead of suggest — 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.