- What Laravel versions does baks-dev/orders-order support, and are there any PHP requirements?
- This package is designed for Laravel 10+ and requires PHP 8.4+. It leverages Symfony components like Messenger and DependencyInjection, so ensure your Laravel installation aligns with these requirements. If you're on an older Laravel version, you may need to upgrade or seek alternatives.
- How do I install and configure the orders-order module for Laravel?
- Run `composer require baks-dev/orders-order` along with its dependencies (e.g., `baks-dev/payment`, `baks-dev/centrifugo`). After installation, set up your `.env` for Messenger (e.g., Redis transport) and Centrifugo, then run `php bin/console baks:assets:install` to configure assets. Start the Messenger worker with `php bin/console messenger:consume orders-order`.
- Does this package work with existing custom order logic or tables in my Laravel app?
- The package assumes Doctrine ORM and may conflict with existing order tables or custom logic. Audit your current order schema and services before integrating. You may need to merge migrations or refactor existing code to avoid collisions, especially if you’re using custom status fields or event dispatchers.
- How do I add custom order statuses like 'Pending Approval' or 'Subscription Paused'?
- Create a service class implementing `OrderStatusInterface` and tag it with `#[AutoconfigureTag('baks.order.status')]`. Define your status transitions and logic in the methods. The package will automatically register your custom statuses. Example: `php artisan make:status CustomStatus` (if supported) or manually create the class as shown in the README.
- What are the real-time capabilities of this module, and do I need Centrifugo for basic order tracking?
- Centrifugo enables WebSocket-based real-time updates for live order dashboards or notifications. If you only need periodic polling or email alerts, you can skip Centrifugo and rely on Laravel’s built-in Queues or Events. However, real-time features require frontend JavaScript listeners and backend WebSocket infrastructure, adding complexity.
- How scalable is this package for high-order volumes, like Black Friday sales or enterprise B2B?
- The package uses Symfony Messenger for async processing, which scales well with Redis or database transports. For 10K+ orders/day, ensure your Redis and database are tuned (e.g., connection pooling, read replicas). Monitor Messenger workers and consider distributed tracing (e.g., OpenTelemetry) for debugging failed jobs or retries.
- Are there alternatives to baks-dev/orders-order for Laravel order management with real-time features?
- Alternatives include Laravel’s built-in Queues + Events for async workflows, or packages like `spatie/laravel-activitylog` for auditing. For real-time, consider `pusher/pusher-php-server` or `beyondcode/laravel-websockets`. However, these lack the DDD structure and status extensibility of `baks-dev/orders-order`. Evaluate your need for Symfony integration before switching.
- How do I test the orders-order module in my Laravel application?
- Run tests with `php bin/phpunit --group=orders-order`. For integration testing, mock dependencies like Centrifugo or Messenger. Use Laravel’s testing tools to verify order creation, status transitions, and async job handling. Ensure your test database matches the Doctrine schema migrations provided by the package.
- What maintenance or governance is required for custom order statuses or workflows?
- Custom statuses implemented via `OrderStatusInterface` require ongoing governance, especially for complex workflows like approval chains. Document business rules, test edge cases (e.g., concurrent status changes), and monitor for conflicts. Consider using feature flags or soft deletes for deprecated statuses to simplify future updates.
- Can I deploy this package to production without Docker, and what are the infrastructure requirements?
- While Docker is recommended for Centrifugo, you can deploy without it by manually configuring WebSocket servers (e.g., Node.js with Socket.io). For production, ensure your Laravel app has a process manager (e.g., Supervisor) for Messenger workers, and monitor Redis/Centrifugo for latency. PHP 8.4+ and Symfony 6.4+ are mandatory; no downgrades are supported.