This is a sample project(POC) that make Laravel works with ReactJS with server side render by a local express server
- PHP 5.6+
- Node 4.0.0+
- Laravel 5.0+
$ composer install
$ npm i
$ npm i
$ php artisan serve --port 8822`
$ gulp watch
- app/React/React.php provides function to talks to the local express server
- app/Provider/ReactServiceProvider.php register the provider and the blade directive
- resources/assets/components.js includes all the JSX file packed for express server and browser (client side rendering)
- resources/assets/global.js register Jquery (not a must for this project actually) to window.$ and react_ujs for client side rendering