- Can I use AnhSapeBundle directly in Laravel without Symfony?
- No, this is a Symfony bundle, not natively Laravel-compatible. You’d need SymfonyBridge or rewrite components for Laravel’s Blade/Twig. A standalone approach (using `anh/sape-php-client`) is simpler and recommended.
- What Laravel version does AnhSapeBundle support?
- The bundle targets Symfony, not Laravel, so no direct Laravel version support exists. If you force integration, ensure compatibility with Symfony components (e.g., HTTP Kernel) used by Laravel via `spatie/laravel-symfony-support`.
- How do I replace Twig functions like `sape_return_links()` in Laravel’s Blade?
- Create a custom Blade directive. For example, in `BladeServiceProvider`, register `@sapeLinks` to call a Laravel service wrapping `SAPE_client`. Avoid Twig entirely unless you bridge it (e.g., `tightenco/ziggy`).
- Is AnhSapeBundle actively maintained? Should I use it for production?
- No, the bundle is unmaintained (1 GitHub star, no recent updates). For production, use `anh/sape-php-client` directly or evaluate official SAPE.ru SDKs. High risk of breaking changes or security gaps.
- What are the risks of pulling in Symfony components for this bundle?
- Symfony dependencies (e.g., HTTP Kernel, Twig) bloat your Laravel app unnecessarily. They may conflict with Laravel’s architecture, increase bundle size, and complicate updates. Prefer lightweight alternatives.
- Does AnhSapeBundle handle payment data securely (GDPR/PCI compliance)?
- No details are provided on data handling. SAPE.ru’s client may log sensitive tokens. For compliance, use a dedicated payment service or wrap the client in a Laravel service with explicit logging controls.
- How do I test AnhSapeBundle in Laravel with Pest/PHPUnit?
- Mock `SAPE_client` directly in your Laravel service layer. Avoid testing Symfony bundle logic—focus on your wrapper’s integration. Use Laravel’s mocking tools (e.g., `createMock()`) for the client’s methods.
- Are there alternatives to AnhSapeBundle for SAPE.ru in Laravel?
- Yes: Use `anh/sape-php-client` standalone, or check for official SAPE.ru SDKs. For affiliate tracking, consider Laravel packages like `spatie/affiliate` or custom services. Avoid monolithic bundles.
- Will AnhSapeBundle block Laravel’s request lifecycle with I/O calls?
- Yes, if `SAPE_client` makes synchronous HTTP calls. For scalability, queue delayed jobs (e.g., `laravel-queue`) or use async processing. Wrap the client in a Laravel service to manage retries/rate limits.
- How do I configure AnhSapeBundle in Laravel’s `config/services.php`?
- You can’t directly. Instead, configure `anh/sape-php-client` in a Laravel service (e.g., `config('services.sape')`) and inject it. The bundle’s YAML config won’t work without Symfony’s Kernel.