- What is shopery/view-bundle and what problem does it solve in Laravel?
- Shopery View Bundle is a Laravel/PHP package for grouping related Blade templates into reusable view bundles. It helps organize layouts, partials, and rendering conventions so presentation code stays modular and easier to maintain across Shopery applications. It integrates with standard Laravel view workflows rather than replacing them.
- How do I install shopery/view-bundle with Composer?
- Install it with Composer using composer require shopery/view-bundle. Then check the package's composer.json and README for service provider registration, since Laravel may auto-discover it. The supplied material does not include the manifest, so confirm the exact install steps on Packagist or the GitHub repository before adding it to a project.
- Which Laravel and PHP versions does shopery/view-bundle support?
- The provided material does not state the declared Laravel or PHP version constraints. Check composer.json for the illuminate/view and illuminate/support ranges before adoption, because small view-layer packages often target a narrow Laravel major. If it supports only Laravel 10, review compatibility before using it on Laravel 11 or 12.
- How do view bundles differ from standard Laravel namespaced views?
- Laravel namespaced views let you reference package views with a vendor::view syntax. View bundles add a grouping layer for related templates, layouts, and partials so rendering conventions can be reused across an application. The package resolves bundled and namespaced views cleanly, but bundles are an organizational convention on top of Laravel's view system.
- How do I register a view bundle in a Laravel application?
- Registration details are not included in the supplied excerpt, so verify the README for provider registration or auto-discovery. A typical Laravel package is installed via Composer and, if needed, its service provider is registered in bootstrap/providers.php or config/app.php. Adopt it incrementally on a few views first to confirm resolution behavior.
- Can I use shopery/view-bundle with existing Blade layouts and partials?
- Yes, the package is intended to work with standard Laravel view workflows and Blade partials. You can keep existing layouts and incrementally move related templates into bundles. Validate a small set of views before migrating large sections, especially if you depend on custom view namespaces or composers.
- Is shopery/view-bundle safe to use in production?
- The package sits in the presentation layer, so it is lower risk than packages that touch persistence, auth, or queues. However, the supplied evaluation notes open questions about whether it decorates the view factory or replaces container bindings. For production, pin the exact version, review the service provider, and test rendered responses before rollout.
- How do I test views that use shopery/view-bundle?
- Test bundled views with Laravel's normal view assertions, such as assertViewIs, assertViewHas, and assertSee, plus feature tests that request pages using the bundle. The supplied material does not confirm whether the package has its own test suite. If you consume any view collection length or count, add regression tests for that behavior because v1.2 changed it.
- What changed in v1.2 and should I upgrade?
- The v1.2 release note says 'Fixed lenght for view collections', which indicates a correction to how view collection length is handled. Treat it as behaviorally significant if your code relies on a length, count, truncation, or layout threshold. Pin the exact version and validate affected rendering paths before upgrading.
- Are there alternatives to shopery/view-bundle for organizing Blade templates?
- Native Laravel namespaced views, view composers, Blade components, and modular package view directories can all organize templates without a dedicated bundle package. Shopery View Bundle is most useful if you want a focused convention for grouping and resolving related views. Compare it with your existing view structure and confirm its Laravel version constraints first.