Looks like you aren't passing $jeus to your view. The code you are using to attach looks fine.
Typically instead of returning a view directly from the store method, you would redirect to the index page, although it should work fine either way.
Couple of other things to note:
This line isn't doing anything, because $idUser isn't accessed again:
$idUser=$user->getId;
You are passing a user into the method but then saving the relationship on auth()->user(). Is that definitely what you want?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.