- What Laravel and PHP versions does baks-dev/ozon-products support?
- The package requires **PHP 8.4+** and **Laravel 10+**. Ensure your project meets these requirements to avoid compatibility issues. Check the `composer.json` constraints for exact version ranges if upgrading.
- How do I handle authentication with Ozon’s API using this package?
- The package abstracts OAuth2 authentication via Laravel’s config system. Store your Ozon API credentials in `.env` (e.g., `OZON_CLIENT_ID`, `OZON_CLIENT_SECRET`) and let the package manage token refreshes automatically. Test token flows in a sandbox environment first.
- Can I customize the product model to match my existing database schema?
- Yes, but you may need to extend the Eloquent model or create migrations. The package assumes fields like `ozon_id` and `external_seller_id`—audit your schema and override the default model with a custom one if needed. Use Laravel’s model events to sync data transformations.
- Does this package support asynchronous product syncs for large catalogs?
- Yes, leverage Laravel’s queue system to process bulk operations asynchronously. Check for `shouldQueue()` on relevant methods in the package’s service layer. Configure a queue worker (e.g., Redis or database) to handle high-volume syncs efficiently.
- How does the package handle rate limits or failed API requests?
- The package includes middleware for rate limiting and retries. Configure thresholds in `config/ozon.php` and extend the HTTP client with custom logic (e.g., exponential backoff) if needed. Monitor failed requests via Laravel’s logging or event listeners.
- What if my product attributes conflict with Ozon’s schema during syncs?
- Use Laravel’s database transactions to wrap sync operations. Implement conflict resolution logic in model observers or event listeners (e.g., prioritize local data or Ozon’s data). The package emits events like `ProductSynced` for custom logic.
- Are there alternatives to this package for Ozon integration in Laravel?
- For Ozon-specific needs, this package is specialized for product management. Alternatives like **spatie/laravel-oauth** (generic OAuth) or **mll-lab/ozon-api** (broader Ozon features) may require more manual setup. Compare feature sets—this package focuses on product workflows with Laravel-native tools.
- How do I run the included PHPUnit tests for this package?
- Execute `php bin/phpunit --group=ozon-products` to run the package’s tests. Integrate them into your CI/CD pipeline to validate API responses, authentication, and data normalization. Focus on testing edge cases like rate limits or schema mismatches.
- Can I extend the package’s functionality without modifying its core files?
- Yes, use Laravel’s service container to bind decorators or middleware. Override facades with custom logic, or listen to events (e.g., `ProductSynced`) to trigger analytics or notifications. Avoid forking—prefer composition over inheritance.
- What production concerns should I address before deploying this package?
- Validate API endpoints in a staging environment, monitor rate limits with Laravel’s logging, and ensure database transactions handle sync failures. Test token refreshes under load and configure queue workers for async operations. Backup critical data before bulk syncs.