PHPackages                             bitsoflove/react-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bitsoflove/react-laravel

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

bitsoflove/react-laravel
========================

Package to use ReactJS with Laravel

v1.2(10y ago)01.6kMITPHP

Since Apr 9Pushed 9y ago5 watchersCompare

[ Source](https://github.com/bitsoflove/react-laravel)[ Packagist](https://packagist.org/packages/bitsoflove/react-laravel)[ RSS](/packages/bitsoflove-react-laravel/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (4)Versions (16)Used By (0)

[![Code Climate](https://camo.githubusercontent.com/cb45f357dd3177ccc714fb66e909acd9f4f66e98ad1127f55288c4e31a98dd9d/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f74616c7973736f6e6f632f72656163742d6c61726176656c2f6261646765732f6770612e737667)](https://codeclimate.com/github/talyssonoc/react-laravel) [![Build Status](https://camo.githubusercontent.com/59d0a00e38d62e6d0b4551ded50f53981a56680c605b439228aa26d0b40df363/68747470733a2f2f7472617669732d63692e6f72672f74616c7973736f6e6f632f72656163742d6c61726176656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/talyssonoc/react-laravel)

react-laravel
=============

[](#react-laravel)

With `react-laravel` you'll be able to use [ReactJS](https://facebook.github.io/react/) components right from your Blade views, with optional server-side rendering, and use them on the client-side with React due to unobtrusive JavaScript.

Installation
============

[](#installation)

V8js dependency
---------------

[](#v8js-dependency)

It's important to know that `react-laravel` has an indirect dependency of the [v8js](https://pecl.php.net/package/v8js) PHP extension.

You can see how to install it here: [how to install v8js](install_v8js.md).

Composer
--------

[](#composer)

You just need to add this to your `composer.json`'s `"require"`:

```
  "talyssonoc/react-laravel": "0.11"
```

Also you got to set the `minimum-stability` of your `composer.json` to `dev`, adding this:

```
  "minimum-stability": "dev"
```

Then run:

```
  $ composer update
```

After that you should add this to your providers at the `config/app.php` file of your Laravel app:

```
  'React\ReactServiceProvider'
```

And then run:

```
  php artisan vendor:publish
```

And the `react.php` file will be available at the `config` folder of your app.

Usage
=====

[](#usage)

After the installation and configuration, you'll be able to use the `@react_component` directive in your views.

The `@react_component` directive accepts 3 arguments:

```
  @react_component([, props, options])

  //example
  @react_component('Message', [ 'title' => 'Hello, World' ], [ 'prerender' => true ])

  // example using namespaced component
  @react_component('Acme.Message', [ 'title' => 'Hello, World' ], [ 'prerender' => true ])
```

- `componentName`: Is the name of the global variable that holds your component. When using [Namespaced Components](https://facebook.github.io/react/docs/jsx-in-depth.html#namespaced-components) you may use dot-notation for the component name.
- `props`: Associative of the `props` that'll be passed to your component
- `options`: Associative array of options that you can pass to the `react-laravel`:
    - `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.js`, `react-dom.js` and `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:

```
  $ php artisan vendor:publish --force
```

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).

Configurations
==============

[](#configurations)

You can change settings to `react-laravel` at the `config/react.php` file:

```
  return [
    'source' => 'path_for_react.js',
    'dom-source' => 'path_for_react-dom.js',
    'dom-server-source' => 'path_for_react-dom-server.js',
    'components' => 'path_for_file_containing_your_components.js'
  ];
```

All of them are optional.

- `source`: defaults to `public/vendor/react-laravel/react.js`.
- `dom-source`: defaults to `public/vendor/react-laravel/react-dom.js`.
- `dom-server-source`: defaults to `public/vendor/react-laravel/react-dom-server.js`.
- `components`: defaults to `public/js/components.js`

Your `components.js` file should also be included at your view, and all your components must be at the `window` object.

Thanks
======

[](#thanks)

This package is inspired at [react-rails](https://github.com/reactjs/react-rails).

---

[![Rollbar Error Tracking](https://camo.githubusercontent.com/662a36c01193328f71cfbfa9391852e665d642ae1eb211f258cdfd8a56bf0474/68747470733a2f2f726f6c6c6261722e636f6d2f6173736574732f6261646765732f726f6c6c6261722d706172746e65722d62616467652d6461726b2e706e67)](https://rollbar.com)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 82.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~65 days

Total

15

Last Release

3654d ago

Major Versions

v0.11 → v1.02016-06-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/12af618decc6a5d5956bf9b61c65c0d8aedd995c525571c748c4e8d457b2535a?d=identicon)[stijntilleman](/maintainers/stijntilleman)

---

Top Contributors

[![talyssonoc](https://avatars.githubusercontent.com/u/4325587?v=4)](https://github.com/talyssonoc "talyssonoc (109 commits)")[![TomCaserta](https://avatars.githubusercontent.com/u/592309?v=4)](https://github.com/TomCaserta "TomCaserta (7 commits)")[![jimpeters](https://avatars.githubusercontent.com/u/1263441?v=4)](https://github.com/jimpeters "jimpeters (4 commits)")[![phaza](https://avatars.githubusercontent.com/u/4553?v=4)](https://github.com/phaza "phaza (3 commits)")[![jeroenverfallie](https://avatars.githubusercontent.com/u/1143308?v=4)](https://github.com/jeroenverfallie "jeroenverfallie (3 commits)")[![18601673727](https://avatars.githubusercontent.com/u/3302620?v=4)](https://github.com/18601673727 "18601673727 (2 commits)")[![awylie199](https://avatars.githubusercontent.com/u/12545202?v=4)](https://github.com/awylie199 "awylie199 (2 commits)")[![rajikaimal](https://avatars.githubusercontent.com/u/8940086?v=4)](https://github.com/rajikaimal "rajikaimal (1 commits)")[![pepijnolivier](https://avatars.githubusercontent.com/u/2015108?v=4)](https://github.com/pepijnolivier "pepijnolivier (1 commits)")

---

Tags

laravelreactreactjs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bitsoflove-react-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/bitsoflove-react-laravel/health.svg)](https://phpackages.com/packages/bitsoflove-react-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[talyssonoc/react-laravel

Package to use ReactJS with Laravel

8934.9k](/packages/talyssonoc-react-laravel)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k9.6k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90128.1k](/packages/emargareten-inertia-modal)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3614.9k](/packages/linkxtr-laravel-qrcode)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
