pollora/wp-rest
Pollora WP REST adds Laravel-style REST API routing to WordPress: register routes and controllers with an expressive syntax, group endpoints, apply middleware, and return clean JSON responses while staying compatible with the native WordPress REST API.
register_rest_route() calls for WordPress products built on the Pollora stack.src/WpRest; the package carries history and an architecture test that limits scope to attributes, discovery, PSR contracts, and WordPress.Pollora\WpRest\* and Pollora\Support\WpGlobals, so existing code extracted from the framework should port with limited namespace churn.Consider it when:
HandlesAttributes attributes.Look elsewhere when:
Pollora\WpRest, Pollora\Support\WpGlobals) or need a vendor-neutral namespace from day one.Executives: This package gives our WordPress products a consistent, testable way to expose REST APIs, reducing bespoke route wiring and making controller code easier to maintain. It is a first release extracted from our framework, not a mature 1.0 dependency; the recommendation is a limited pilot tied to the framework’s next release, with broader adoption gated on 1.0.0. The upside is lower maintenance and reuse outside full Laravel; the risk is pre-1.0 API change and dependence on Pollora conventions.
Engineering: v0.1.0 extracts src/WpRest with its history intact. Controllers are discovered and built by an instance resolver with constructor dependencies; custom HandlesAttributes attributes receive the PSR-11 container passed to WpRestDiscovery. It does not require Laravel’s application, and an architecture test constrains the package to attributes, discovery, PSR contracts, and WordPress. That makes it easy to reason about and test, but also means no Laravel-specific magic. Class names remain Pollora\WpRest\* and Pollora\Support\WpGlobals, so migration from framework code should be mostly namespace and package wiring. Expect API stabilization at 1.0.0; pin v0.1.x, pilot one endpoint set, and track the framework release before committing multiple teams.
How can I help you explore Laravel packages today?