Tuesday, April 4, 2017

Query with eloquent

I try to display the rugdy matchs from a structure

my table team (Equipe):

  • name_team
  • structure_id

my table Match (Rencontre)

  • team_1 ( equipe_domicile_id)
  • team_2 (equipe_visiteur_id)

i would like to display to the user the matchs from his team ( team 1 or team 2 ) i need to make a join but i don't know how to achieve this . someone knows how to do that ? thanks a lot in advance

here my query : $rencontres = Rencontre::where('equipe_domicile_id' , '=' ,'structure_id' => Auth::user()->structure->id);



via Mathieu Mourareau

Advertisement