becklyn/hosting
Becklyn Hosting eases hosting integration for Symfony apps: configure tier, project, installation, and TrackJS; access HostingConfig; auto-inject uptime monitor comments into HTML; embed monitoring JS via Twig; and use the @hosting namespace.
tier (production/staging/development), project, and installation — instead of scattered APP_ENV checks. That's a decision you can adopt regardless of stack: standardize a tier vocabulary and make it a config contract every service reads, so "what tier is this?" is answerable without reading code.hosting_tier() helper for conditional template logic) is roughly a day of engineering. The package's real value is the decision record: it proves these are small, reusable concerns worth centralizing rather than re-implementing per project.isInDevelopmentTier, hosting_tier()) supports roadmap decisions like "canary to staging before production" and "never ship debug tooling to production." Low cost, high leverage if you have >2 environments.project + installation (a unique technical key) is a lightweight tenancy model for SaaS or agency portfolios — useful for correlating uptime checks and error reports per customer installation without standing up a service registry.Consider the pattern (strongly) if:
if (app()->environment('production')) in views and middleware.Look elsewhere — or don't adopt the code at all — if:
config/hosting.php. Adopting it means pulling Symfony DI/HttpKernel pieces into a Laravel app to use ~50 lines of logic. That is a net-negative trade; copy the idea instead.hosting_embed_monitoring() has no Blade equivalent, so you're writing it anyway.Decision rule: adopt as a reference spec and reimplement as ~150 lines of Laravel middleware + a Blade directive + a config/hosting.php. Only vendor the package itself if you are genuinely on Symfony and already use the Becklyn asset bundle.
Executives (one paragraph): "This is a small Symfony bundle that centralizes three things we currently do by hand: telling the app which environment it's running in, injecting an uptime-monitor marker into HTML, and loading error tracking only in production. It's not a platform — it's a template. My recommendation is not to take a dependency on it (one maintainer, no downstream users, Symfony-only), but to copy its config model — tier, project, installation — into a ~1-day internal implementation. That gets us consistent monitoring across every project and removes a recurring class of 'why didn't staging show up in the dashboard' tickets, with no vendor risk."
Engineering (the pitch): "Three config keys, one service, two template helpers. We mirror it in Laravel: config/hosting.php for tier/project/installation, a global middleware that appends the uptime comment to HTML responses (skip BinaryFileResponse equivalents and anything without a Content-Type), and a @hostingMonitor Blade directive that no-ops outside production/staging. Reuse their validation of tier names and their listener-ordering lesson (inject last, after other listeners have shaped the response). Roughly a day of work, no new dependencies, and it kills the env() calls scattered through our views."
Product framing for the roadmap: treat tier as a product primitive, not an ops detail — it's what lets us ship risky features to staging first, keep debug tooling out of customer-visible HTML, and give every customer installation an identifier that support and monitoring can both quote.
How can I help you explore Laravel packages today?