goldnead/statamic-private-media
Statamic addon for serving media files privately: route asset access through Laravel authentication and authorization so protected uploads are only delivered to permitted users, while public assets remain unaffected.
Architecture fit. This is a Statamic addon built on Laravel's service provider lifecycle. It extends Statamic's AddonServiceProvider and uses bootAddon() as its registration hook, which is the idiomatic extension point. The v0.1.1 fix is architecturally meaningful: the package previously overrode bootRoutes(), bootCommands() and bootPublishables(), while Statamic's base boot() already invokes those before bootAddon(). That produced double registration of the delivery route, the prune command, and the publishables. The corrected version defers entirely to the parent lifecycle, which is the lower-risk arrangement and signals the maintainer understands the framework contract rather than working around it.
Integration feasibility. Presumably installable via Composer with Laravel package auto-discovery, requiring a publish/migrate step and a scheduled prune. Small surface area: one route, one command, a set of publishable assets. The main integration work is configuration and scheduling, not code.
Technical risk. Low to moderate. The fixed defect was a real but bounded class of bug — duplicate route entries (ambiguous matching, confusing route:list output), duplicated command listings, and repeated publish tags. It would not typically corrupt data, but it can mask which registration is authoritative and complicate debugging. The larger risk is maturity: this is a 0.1.x package, so the public API, config schema, and publishables are not yet stable.
Key questions.
bootAddon() the only intended extension point, or does the package expect consumers to subclass the provider?Stack fit. Targets Laravel applications running Statamic. No non-standard dependencies are implied. Fits cleanly into an existing Statamic site as an addon rather than a standalone package, so it inherits the host app's routing, console, and publishing conventions.
Migration path. Greenfield installs are straightforward: require the package, publish config and any migrations/assets, run migrations, and schedule the prune command. For anyone who installed v0.1.0, this is a drop-in patch with no data or config migration — but they should verify that duplicate registrations from the earlier version have not left stale cached routes or duplicated scheduled entries.
Compatibility. The fix depends on the host Statamic version's AddonServiceProvider::boot() calling bootRoutes(), bootCommands() and bootPublishables() before bootAddon(). Pin a Statamic range known to behave that way and re-verify on Statamic minor upgrades, since addon lifecycle ordering is the exact seam this release touches. Confirm the Laravel version range against the host app's constraint before requiring.
Sequencing.
php artisan route:list and php artisan list and assert exactly one delivery route and one prune command appear.vendor:publish.Maintenance. Small code surface, but pre-1.0 versioning means minor releases may carry breaking changes. Assign an internal owner and review each release note rather than floating the constraint. The v0.1.1 fix is itself a signal that registration behavior is still being stabilized.
Support. Upstream is a single maintainer path until proven otherwise; assume best-effort. Internal runbooks should cover how to inspect registered routes and commands, since that is where the fixed defect manifested.
Scaling. The delivery route plus prune command implies accumulating records or artifacts. Prune cadence is the primary scaling lever: too infrequent and storage grows unbounded; too aggressive and delivery history disappears. Size the retention window against expected delivery volume before production rollout, and monitor table growth.
Failure modes.
Ramp-up. Low for a developer already fluent in Laravel service providers and Statamic addons — roughly a half-day to install, verify single registration, and validate the prune. A TPM should budget a short verification spike specifically around the lifecycle behavior this release changed, and treat the package as early-adopter until it reaches 1.0 or accumulates a stable release history.
How can I help you explore Laravel packages today?