torann/device-view
Laravel package that detects the visitor's device type and serves different views for mobile, tablet, and desktop. Register device-specific view paths and fall back cleanly when no matching view exists. Small and config-driven.
if ($mobile) branches through controllers. Every other decision below is downstream of this one.home.mobile with the three revenue-critical modules and leave desktop untouched. Present it as scope relief that buys time, not a platform bet — and put an expiry date on it in the roadmap so it doesn't quietly become permanent architecture.DeviceViewResolver interface in a day or two. "Buy" only wins if the cost of ~100 lines exceeds the cost of auditing an unmaintained dependency — which, for most teams, it does not. Whatever you choose, record it; "just add the package" is the wrong default here.0.0.x, 14 stars, zero dependents, a single maintainer, and a last release in January 2017 whose only content is "Support Laravel 5.4," this is a legacy-estate artifact, not a forward-looking dependency. It warrants a dependency-register entry with an exact pin and a named replacement date, and it should inform — not drive — framework-upgrade planning, because a caret constraint on 0.0.x will never float onto a modern Laravel.Vary: User-Agent and a CDN cache key that includes the UA or the package's device cookie. If the product depends on aggressive full-page caching or a URL-keyed CDN, this package's value proposition shrinks and may go net-negative. Separately, separate mobile HTML has mobile-first-indexing consequences that need a named SEO owner's sign-off before launch, not after.Consider it when:
config/app.php and an exact pin are part of the deal.composer require "torann/device-view:0.0.4"). A caret constraint on a 0.0.x line is a pin in disguise — safe, but it also means the package will never tell you it has become dead weight, so the register entry must carry the replacement date.php artisan config:cache before it reaches a release week. Packages of this vintage routinely call env() outside config/*.php and only break in cached production deploys.Look elsewhere (or build it) when:
view.finder for theming or multi-tenant template overrides. The finder is a shared extension point; two decorators interact in an order you did not choose, and you would be resolving that instead of shipping.For executives: This is a small, free, unmaintained package from 2017 that lets one Laravel application serve different page templates to phones, tablets, and desktops at the same URL. It supports exactly one product decision — whether to invest in a reduced mobile experience now rather than wait for a full redesign — and it buys that option cheaply in engineering time. What it is not is a platform investment or a differentiator: no user-visible capability arrives that responsive CSS couldn't also deliver. The cost structure is the part to hear clearly: the package is a day of integration, the variants are weeks of design, translation, QA, and ongoing drift risk, plus a caching and SEO review before launch. Because it is a single-maintainer dependency with a last release that only declared Laravel 5.4 support, the recommendation is to build or vendor the ~100 lines rather than depend on it, and if we do take it, to pin the exact version and put a replacement date in the dependency register.
For engineering: Treat it as a legacy artifact, not a dependency. The only part you will ever need to reimplement is the finder decoration: resolve a view name, suffix it by device class, check view()->exists(), fall back to desktop. Wrap it behind our own DeviceViewResolver interface on day one so no application code imports Torann\... and replacement is a one-file change. Start with a layout swap (layouts.app → layouts.app.mobile) rather than per-page variants; escalate page-by-page only where the module list genuinely diverges, so the QA multiplier stays bounded. Add middleware for Vary: User-Agent and for a "view full site" desktop override, since the package provides neither. Make silent fallback loud: log a warning when a non-desktop device hits a missing variant, and run a CI audit command that fails on unexpected gaps against an explicit desktop-only allow-list. Verify three things explicitly before rollout — that the finder still resolves under config:cache, that view composers registered against the base layout name actually fire on the variant, and that namespaced views and view()->first() behave. Test with explicit user agents per device class; the test client's default UA will silently resolve to desktop and your mobile tests will pass without ever exercising the path.
How can I help you explore Laravel packages today?