📅  最后修改于: 2022-03-11 14:57:09.549000             🧑  作者: Mango
// Inside AppServiceProvider::boot
Blade::include('includes.react', 'react');
// Create a includes/react.blade.php file
//Inside your views just include ($props must be an array)
@react(['id' => 'user-dropdown', 'props' => $props])
//Using this approach you can pass more complex data:
@react([
'id' => 'user-dropdown',
'props' => [
'name' => Auth::user()->name,
'obj' => [
'bla' => ['id' => 1]
],
'arr' => [1,2,3]
]
])