baks-dev/four-tochki-products
Laravel/PHP 8.4+ модуль интеграции с 4tochki: импорт и синхронизация каталога продукции, работа со складами партнёра (идентификаторы через b2b.4tochki.ru). Установка через Composer, assets:install, миграции Doctrine; есть PHPUnit-тесты.
Pros:
KernelEvents), which can be mapped to Laravel’s events/listeners for extensibility.Cons:
symfony/console, doctrine/orm), which may introduce stack complexity if the team is Laravel-only.Product or Warehouse tables). Requires schema reconciliation.Laravel Compatibility:
ProductController for 4tochki product listings).baks:assets:install and migration commands can be replaced with Artisan commands or run as standalone scripts.Key Integration Points:
| Bundle Feature | Laravel Integration Strategy |
|---|---|
| Doctrine ORM | Use Eloquent Doctrine Bridge or port to Eloquent incrementally. |
| Symfony Console Commands | Replace with Artisan commands or call via Process facade. |
| Event System | Map Symfony events to Laravel’s Event facade or use Laravel’s dispatch(). |
| API Clients | Extend with custom HTTP clients (e.g., Guzzle) for 4tochki-specific logic. |
| Migrations | Run in staging first, then reconcile with Laravel’s migrations using manual SQL or tools like schema:update. |
Critical Risks:
products, warehouses). Mitigation: Use a shared database with separate schemas or manual reconciliation.symfony/http-kernel vs. Laravel’s illuminate/container). Mitigation: Containerize the bundle or isolate it in a microservice.Moderate Risks:
Low Risks:
Architecture:
Integration:
Operations:
Long-Term:
Team:
Primary Fit:
Console, HttpClient, and EventDispatcher where beneficial (e.g., for complex CLI tools or event-driven workflows).Secondary Fit:
Misfit Areas:
| Phase | Objective | Steps |
|---|---|---|
| Assessment | Validate feasibility and scope. | 1. Set up a test environment with the bundle in Symfony. |
2. Run php bin/console baks:assets:install and review generated schemas. |
||
| 3. Benchmark sync performance (e.g., 100 products) vs. a custom API client. | ||
| 4. Identify schema conflicts with Laravel’s existing DB. | ||
| Pilot | Test with a non-critical product category. | 1. Isolate the bundle in a Symfony microservice or Docker container. |
| 2. Build API endpoints to expose product/warehouse data to Laravel. | ||
| 3. Implement basic sync workflows (e.g., create/update products). | ||
| 4. Monitor for errors, performance bottlenecks, and edge cases. | ||
| Integration | Merge with Laravel core. | 1. Port Doctrine models to Eloquent incrementally (start with Product). |
| 2. Replace Symfony console commands with Artisan commands. | ||
3. Reconcile migrations: Use doctrine:migrations:diff in staging, then adapt for Laravel. |
||
4. Integrate event listeners (e.g., ProductCreated) into Laravel’s event system. |
||
| Optimization | Refine for production. | 1. Optimize queries (e.g., add indexes, use Eloquent accessors). |
| 2. Implement retry logic for failed syncs (e.g., Laravel Horizon queues). | ||
| 3. Build monitoring dashboards (e.g., sync success rates, inventory accuracy). | ||
| 4. Document customization points (e.g., how to extend warehouse logic). |
How can I help you explore Laravel packages today?