mercredi 26 août 2015

Laravel receive information from user

I've two tables an user table and a car table. So when a user is logged in I want to show his cars (with lots of information). But how do I do this in the controller? And give the right car information from that user? I've already set the relations but how do I receive the right information in the controller?

I was thinking about this:

$car = car()->user();
        return view('cars.index',compact('usercar','car'));

Off course this is wrong, but what's the right way?

Thankyou.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1hg3pHG
via IFTTT

Aucun commentaire:

Enregistrer un commentaire