- What does the roundly-consulting/shops-for-laravel package do?
- It adds a lightweight, domain-agnostic shop and location layer to Laravel applications, including publishable migrations, Eloquent models, and configuration. You can attach products, opening hours, staff, or similar data to individual storefronts without rebuilding the same schema. The package is framework-native and has no external dependencies, and it can integrate with existing models through configurable keys.
- How do I install and set up shops-for-laravel?
- Install it with Composer using composer require roundly-consulting/shops-for-laravel, then publish the package config and migrations and run php artisan migrate. The overview says the package ships publishable migrations and config for full control. Because the provided assessment did not include the README or source, confirm the exact publish tags and service provider steps in the repository documentation before rolling it out.
- Can I use a custom Shop model with shops-for-laravel?
- Yes. The package follows a swappable-model pattern, so the host application can configure its own shop or tenant model instead of using the packaged base Shop model. The critical requirement is that your custom model must extend the package Shop class. ShopModel::shop() centralizes resolution of the configured tenant class, but it returns that class only when it extends Shop.
- What does ShopModel::shop() return?
- It returns a class-string for the configured shop model, not an Eloquent instance or a query builder. That means you would call ShopModel::shop()::query() or ShopModel::shop()::factory() when you need a query or factory. The assessment notes that the return type may not be clearly documented, so verify the behavior in the source or README before relying on it.
- Why is my custom shop model being ignored?
- The most likely cause is that your configured model does not extend the package Shop class. In that case ShopModel::shop() appears to silently fall back to the base Shop model instead of throwing an error or logging a warning. Confirm the inheritance, set the configured tenant class correctly, and add a test that asserts the resolved class is your custom model.
- Does shops-for-laravel work for multi-shop or multi-tenant applications?
- It is designed around storefront scoping for multi-shop queries and configurable keys, so it fits typical multi-tenant SaaS patterns where each shop or tenant has a domain model. It works best when the host treats the packaged Shop as a base class and extends it. If you use a separate tenancy package for database-per-tenant or domain-based tenancy, verify that shop model resolution does not conflict with tenant bootstrapping or connection switching.
- Which Laravel and PHP versions does shops-for-laravel support?
- The provided assessment covers release notes for version 1.1.0 only and does not state Laravel or PHP version constraints. Check the package composer.json, Packagist page, README, and CI matrix for the supported Laravel and PHP versions. Pin to ^1.1.0 only after confirming those constraints match your application.
- Is shops-for-laravel production-ready?
- The assessment rates overall technical risk as medium-low, with integration feasibility low-to-moderate. The main risk is the silent fallback when a configured shop model does not extend the package Shop class, which can make tenant-specific behavior disappear without an error. For production, pin ^1.1.0, audit direct references to the base Shop model, and run your full test suite, especially factory and seeder tests.
- How does the 1.1.0 factory change affect my tests?
- In 1.1.0, factories build the configured shop model, which aligns test and seeding behavior with runtime configuration. That is a correctness fix, but it can change existing test fixtures if a custom model was configured and previously not honored. Update any assertions that expected base Shop instances and rerun factory and seeder tests.
- Is shops-for-laravel actively maintained and backward compatible?
- Version 1.1.0 is described as a minor release with an added method and a bug fix, and no deprecations or breaking changes are declared. Runtime code is expected to be backward compatible, though the factory fix may require test updates. The assessment did not include repository activity, source, docs, or tests, so review the GitHub repository and release history to judge maintenance and CI coverage.