morningtrain/laravel-react

A context helper package for Laravel

2.1.2 2021-04-29 10:13 UTC

This package is auto-updated.

Last update: 2022-06-29 01:20:38 UTC


README

React for Laravel

Install

Via Composer

$ composer require morningtrain/laravel-react

Usage

View

In your controller:

return view('your_view')->with([
    'component' => 'Welcome',
    'props'     => [
        'title' => 'From controller',
    ],
    'options'   => [],
]);

And in your view:

@react()

Or straight from view:

@react([
    'component' => 'Welcome',
    'props' => [
        'title' => 'From view',
    ],
    'options' => [],
])

Credits