lundi 25 janvier 2016

Pass the data in the many to many relation ship in laravel

I have create a form that will show the user the event title, event description. And the code

public function show($id){

            $showevents = Events::findOrFail($id);
            return view('events.show',compact('showevents'));
    }

This data i pass dont have the user data, but it will give me the specific event data. My question is how to pass the user data along with this? Because my event table dont have the user information, it all in the user table. I try {{$showevents->user->name}} in the view form, but it doesnt give me the information of the user.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire