- Can I use baks-dev/users-address in a Laravel project that only uses Eloquent ORM?
- No, this package requires Doctrine ORM, which is not natively compatible with Eloquent. You’d need a compatibility layer or adapter to bridge the two, which could introduce complexity and performance overhead. If Eloquent is critical, consider alternatives like spatie/laravel-address or custom solutions.
- What Laravel versions does baks-dev/users-address support?
- The package explicitly supports Laravel projects using Doctrine ORM, but the exact Laravel version compatibility isn’t specified. Since it requires PHP 8.4+, it likely aligns with Laravel 10+ or newer. Check the package’s documentation or GitHub issues for precise version details before installation.
- How do I handle multi-address scenarios (e.g., home, work, billing) with this package?
- The package is designed to support multiple addresses per user out of the box. You can assign different address types (e.g., home, work) during creation or update via the provided CRUD methods. Geocoding and validation rules are applied consistently across all addresses.
- Are there any known conflicts if my app already has address-related tables?
- Yes, conflicts are possible if your existing schema overlaps with the package’s Doctrine entities (e.g., `users_addresses` table). Run `doctrine:migrations:diff` before migrating to identify conflicts. Consider a schema audit or custom migration adjustments to resolve overlaps.
- How do I install assets and configure the package after Composer installation?
- Run `php bin/console baks:assets:install` to set up configuration files and assets. This command handles the initial setup, including publishing config files and any required views or resources. Ensure your `bin/console` path is correct if running outside Laravel’s default structure.
- Does this package support international address formats (e.g., non-Latin scripts, country-specific rules)?
- The package includes validation rules, but support for international formats depends on the underlying geocoding service and Doctrine constraints. Test thoroughly with your target regions, as edge cases (e.g., Japanese or Arabic addresses) may require custom validation or geocoding provider adjustments.
- Can I extend or override the geocoding logic in baks-dev/users-address?
- The package likely relies on a default geocoding provider, but extensibility depends on exposed interfaces or service bindings. Review the source code for `GeocodingService` or similar classes to identify extension points. If none exist, you may need to wrap the package’s logic in a custom service.
- How do I run the provided PHPUnit tests for this package?
- Execute `php bin/phpunit --group=users-address` to run the package’s test suite. Ensure your Laravel environment is properly configured with Doctrine and the package installed. If tests fail, check for missing dependencies or configuration issues in the test setup.
- What are the performance implications of using Doctrine ORM with this package?
- Doctrine ORM may introduce overhead compared to Eloquent, especially for high-read/write operations. Benchmark the package in a staging environment to assess impact. Optimize queries, use caching for geocoding results, and consider indexing critical columns in the `users_addresses` table.
- Are there alternatives to baks-dev/users-address for Laravel address management?
- Yes, alternatives include spatie/laravel-address (Eloquent-based), laravel-address (community-driven), or custom solutions using Laravel’s built-in validation and geocoding services. Choose based on your ORM preference (Doctrine vs. Eloquent) and whether you need multi-address support or geocoding.