Support the ongoing development of →
Eloquent Authentication
Last updated 2 years ago.

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!


Your banner here too?

Lucas meneldii Joined 14 Jun 2021


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.