morningtrain / laravel-react
A context helper package for Laravel
Installs: 2 611
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- guzzlehttp/guzzle: ^6.3|^7.0
- illuminate/console: ^7.0|^8.0|^9.0|^10.0
- illuminate/filesystem: ^7.0|^8.0|^9.0|^10.0
- illuminate/support: ^7.0|^8.0|^9.0|^10.0
- laravel/ui: ^2.0|^3.0|^4.0
- morningtrain/laravel-support: ^1.0
- nesbot/carbon: ^2.16
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' => [], ])