spatie/laravel-symfony-components). The bundle’s modular design (orders, payments, API integration) aligns with Laravel’s service-oriented architecture but introduces Doctrine ORM dependency, which may conflict with Eloquent. A hybrid approach (Doctrine for 4tochki-specific models, Eloquent for core) is feasible but adds complexity.KernelEvents), which can be mapped to Laravel’s event system with minimal effort.baks:assets:install and migration scripts are Symfony-specific. Replacement with Laravel Artisan commands or custom scripts is necessary.FourTochkiOrder) while keeping core models in Eloquent.laravel-doctrine/orm to bridge Doctrine and Eloquent.four-tochki-orders group) raises concerns about edge cases (e.g., API failures, payment retries, webhook validation).shouldQueue()) replace Symfony’s event system?.env integration work?spatie/laravel-symfony-components to integrate Symfony’s HttpFoundation, Console, and DependencyInjection into Laravel.Container with Laravel’s service container for dependency injection.FourTochkiOrderService, FourTochkiPaymentService) using Laravel’s HTTP client or Guzzle.class FourTochkiOrderService {
public function __construct(private HttpClient $http) {}
public function createOrder(array $data): array {
return $this->http->post('https://api.4tochki.ru/orders', $data);
}
}
// Symfony event (in bundle)
$dispatcher->dispatch(new OrderCreatedEvent($order));
// Laravel equivalent
event(new \App\Events\FourTochkiOrderCreated($order));
FourTochkiOrder) and Eloquent for core models.laravel-doctrine/orm to manage Doctrine entities alongside Eloquent models.Phase 1: Dependency Isolation
Vendor\FourTochki) to avoid autoloading Symfony services globally.php artisan doctrine:migrations:migrate --path=vendor/baks-dev/four-tochki-orders/migrations
php artisan fourtochki:install-assets).Phase 2: Hybrid ORM Implementation
doctrine/orm to composer.json.AppServiceProvider:
$this->app->bind(\Doctrine\ORM\EntityManagerInterface::class, function ($app) {
return EntityManager::create([...], $app['config']['doctrine']);
});
HybridRepository).Phase 3: Event and Console Replacement
FourTochkiOrderCreated, FourTochkiPaymentProcessed, etc.public function handle(FourTochkiOrderCreated $event) {
// Sync with Laravel's orders table or trigger other logic
}
baks:assets:install with a Laravel command that copies assets to public/4tochki.Phase 4: API Wrapper Layer
class FourTochkiFacade {
public static function createOrder(array $data) {
return app(FourTochkiOrderService::class)->createOrder($data);
}
}
Container, EventDispatcher, and Console components require wrappers. Mitigation:
EventDispatcher with Laravel’s Event facade.orders table).How can I help you explore Laravel packages today?