Download the PHP package bitsoflove/react-laravel without Composer
On this page you can find all versions of the php package bitsoflove/react-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
All versions of react-laravel with dependencies
Informations about the package react-laravel
It's important to know that
react-laravel has an indirect dependency of the v8js PHP extension.
You can see how to install it here: how to install v8js.
You just need to add this to your
Also you got to set the
minimum-stability of your
dev, adding this:
After that you should add this to your providers at the
config/app.php file of your Laravel app:
And then run:
react.php file will be available at the
config folder of your app.
After the installation and configuration, you'll be able to use the
@react_component directive in your views.
@react_component directive accepts 3 arguments:
componentName: Is the name of the global variable that holds your component. When using Namespaced Components you may use dot-notation for the component name.
props: Associative of the
propsthat'll be passed to your component
options: Associative array of options that you can pass to the
prerender: Tells react-laravel to render your component server-side, and then just mount it on the client-side. Default to true.
tag: The tag of the element that'll hold your component. Default to 'div'.
- html attributes: Any other valid HTML attribute that will be added to the wrapper element of your component. Example:
'id' => 'my_component'.
All your components should be inside
public/js/components.js (you can configure it, see below) and be global.
You must include
react_ujs.js (in this order) in your view. You can concatenate these files together using laravel-elixir.
react-laravel provides a ReactJS installation and the
react_us.js file, they'll be at
public/vendor/react-laravel folder after you install
react-laravel and run:
For using the files provided by
react-laravel and your
components.js file, add this to your view:
If you'll use a different version from the one provided by react-laravel (see
composer.json), you got to configure it (see below).
You can change settings to
react-laravel at the
All of them are optional.
source: defaults to
dom-source: defaults to
dom-server-source: defaults to
components: defaults to
components.js file should also be included at your view, and all your components must be at the
This package is inspired at react-rails.