- Can I use this bundle directly in a pure Laravel project without Symfony?
- No, this bundle is Symfony-native and requires Symfony components like Dependency Injection and HttpKernel. For Laravel, use the API-only approach or integrate via Laravel Symfony Bridge (e.g., `spatie/symfony`). Pure Laravel projects may need a custom PHP parser or alternative like `spatie/laravel-log-viewer`.
- How do I integrate the Vue 3 frontend into Laravel?
- Use Laravel’s Vite or Mix to bundle the Vue 3 SPA. Place the frontend assets in `resources/js/` and compile them with Laravel’s build process. The Vue app can then be embedded via Blade or served as a standalone page. Ensure Vue 3 dependencies are compatible with your Laravel setup.
- What Laravel versions does this bundle support?
- The bundle itself doesn’t natively support Laravel, but if you use the API-only approach or Laravel Symfony Bridge, it can work with Laravel 8.x–10.x. For direct Symfony integration, ensure your Laravel project includes Symfony components like `symfony/dependency-injection` (v6.x). Test thoroughly for compatibility.
- Does the Go parser work in Laravel environments?
- The Go parser requires a Go binary in your `vendor/bin/` directory. If Go isn’t available, the bundle falls back to a PHP parser. Ensure your Laravel CI/CD or server has Go installed (or use Docker) for full functionality. The PHP parser is lightweight but slower for large logs.
- Can I fetch logs via API without installing the full bundle?
- Yes! Deploy the bundle in a separate Symfony microservice (e.g., Docker) and consume its REST API from Laravel using `Http::get()`. This avoids Symfony dependencies in Laravel while still leveraging the bundle’s log-reading capabilities. Example: `$logs = Http::get('http://symfony-service/api/logs');`.
- How do I handle remote logs (SSH/SFTP) in Laravel?
- The bundle supports remote logs via SSH/SFTP, but Laravel requires the `phpseclib` or `ssh2` PHP extension. Install it via `pecl install ssh2` or `composer require phpseclib/phpseclib`. If using the API approach, ensure the Symfony service has SSH access configured. For pure Laravel, consider `spatie/laravel-log-viewer` or custom SSH logic.
- Are there alternatives for Laravel that don’t require Symfony?
- Yes! For Laravel, consider `spatie/laravel-log-viewer` (Monolog-focused), `barryvdh/laravel-debugbar` (for debugging), or `monolog/monolog` with a custom UI. If you need advanced features like regex search or live logs, you may still need to adapt this bundle via API or Symfony Bridge.
- How do I configure the bundle for Monolog in Laravel?
- Laravel already uses Monolog, so the bundle will work with your existing log configuration. If using the API approach, ensure your Laravel logs are written to files Monolog can read (e.g., `storage/logs/laravel.log`). For Symfony integration, merge Laravel’s Monolog handlers into Symfony’s container via custom DI configuration.
- Will this bundle work with Laravel’s queue-based logging?
- No, the bundle reads log files directly and doesn’t integrate with Laravel’s queue-based logging (e.g., `Log::channel('queue')`). For queued logs, ensure they’re written to files first or use a separate solution like `spatie/laravel-activitylog` for structured logging. The bundle’s API can still fetch file-based logs.
- How do I test this bundle in a Laravel project?
- For API-only testing, mock the Symfony service’s endpoints using Laravel’s `Http::fake()` or Pest. For Symfony integration, test the merged DI container and Vue frontend in isolation. Use Laravel’s `Artisan::call()` to verify log file parsing. Ensure your test environment matches production (e.g., Go binary availability).