davidcole1340/reactsh
Reactsh provides a lightweight Laravel/PHP bridge for working with React and modern frontend tooling. It aims to simplify integrating React components into server-rendered apps with straightforward setup and sensible defaults for local development and builds.
reactsh is a minimal ReactPHP-based REPL (Read-Eval-Print Loop) for interactive PHP development using async programming patterns. To start:
composer require davidcole1340/reactsh --dev./vendor/bin/reactshIt’s designed for quick experimentation (e.g., testing HTTP clients, event loops, or timers), not production usage. Start by trying basic async commands:
$loop = React\EventLoop\Factory::create();
$loop->addTimer(1, fn() => echo "Hello\n");
reactsh to quickly prototype asynchronous workflows before committing to a full script or CLI app.guzzlehttp/promises), or database connection pools with real-time feedback.$loop), pending timers, streams, or watchers — helpful for diagnosing stalls in async apps.Tip: Combine with Laravel’s artisan tinker—reactsh focuses on async primitives, while Tinker handles Eloquent/state.
psy/psysh, there’s no readline support or command history by default (depending on environment). On Unix, try rlwrap vendor/bin/reactsh to add line editing/history.$loop->run() explicitly after creating a promise to see side effects — otherwise, code silently exits after reactsh starts the loop.try/catch and var_dump() liberally during debugging.react/event-loop:^1.4). Consider reactphp/react’s own REPL (reactphp/repl) for more recent support.require: You can inject custom helpers by prepending a bootstrap file: reactsh -d auto_prepend_file=helpers.php — useful for adding Laravel bootstrapping or utility functions.How can I help you explore Laravel packages today?