0👍
and the reason is so simple below in the Controller dir, I used App\Models\User
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\User;
class FollowsController extends Controller
{
public function store(App\Models\User $user)
{
return $user->username;
}
}
instead of User after declaring the use method.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\User;
class FollowsController extends Controller
{
public function store(User $user)
{
return $user->username;
}
}
- [Vuejs]-MultipartFile recieved null when using vs-upload to upload file in spring boot
- [Vuejs]-How to pass text with <b> tag having bold effect in <v-textarea> from the data() of vue app?
0👍
And to get data from laravel blade.php we can simply use
<script>
let userId = '{{ $user->id }}';
</script>
Now we can use the ‘userId’ variable to our react component.
ThankQ!
Source:stackexchange.com