- Can I use clue/term-react directly in a Laravel HTTP request or controller?
- No, this package is built for ReactPHP’s event loop and won’t work natively in Laravel’s synchronous request-response cycle. You’d need to run it in a separate process (e.g., a ReactPHP daemon) and communicate via IPC (Redis, sockets, or HTTP).
- What Laravel use cases justify integrating clue/term-react?
- This package is only relevant for Laravel if you’re building async CLI tools, real-time terminal input processing (e.g., interactive commands), or integrating with external terminal-based services. For most HTTP workflows, Laravel’s `Symfony/Process` is simpler.
- How do I install clue/term-react in a Laravel project?
- Run `composer require clue/term-react` in your project root. However, you’ll also need `reactphp/react` and other ReactPHP dependencies. Note: This won’t integrate with Laravel’s core—it’s for standalone ReactPHP apps or sidecar processes.
- Does clue/term-react support Laravel’s queue workers (e.g., Horizon) or CLI commands?
- No, it’s designed for ReactPHP’s event loop, not Laravel’s Artisan commands or queue workers. You’d need to run it in a separate process and trigger it via IPC or HTTP calls from Laravel.
- Will clue/term-react work with Laravel’s Symfony Process for CLI tasks?
- No, this package processes *streaming* terminal input/output, not one-off CLI commands. For simple CLI tasks, use `Symfony/Process` or `Symfony/ProcessBuilder`. This package is for low-level terminal I/O parsing.
- Are there any Laravel-specific alternatives to clue/term-react?
- For Laravel, consider `symfony/process` for CLI tasks or `php-console/color` for ANSI color handling. If you *must* use ReactPHP, isolate it in a microservice and communicate via queues (e.g., Laravel + Redis).
- How does PHP 8.3 compatibility affect Laravel integration?
- PHP 8.3 support improves stability, but Laravel’s internal ReactPHP usage (e.g., in `illuminate/support`) may still conflict. Test thoroughly in a separate ReactPHP process—avoid mixing event loops with Laravel’s synchronous components.
- Can I use clue/term-react in Laravel’s testing (e.g., Pest or PHPUnit)?
- Only in isolated ReactPHP tests. Laravel’s test suite runs synchronously, so you’d need to mock or stub the terminal stream. Avoid mixing ReactPHP streams with Laravel’s test helpers.
- What’s the maintenance risk of using clue/term-react in production?
- High. The package has low Laravel adoption (104 stars) and no native Laravel integration. You’ll need ReactPHP expertise to debug event-loop issues, and Symfony updates may introduce conflicts.
- How do I handle terminal input/output in Laravel without ReactPHP?
- For most cases, use `Symfony/Process` for CLI tasks or `php-console/color` for ANSI output. If you need real-time terminal parsing, consider a lightweight PHP extension (e.g., `ext-readline`) or a dedicated microservice.