laravel - Complex Multi-level Laravel4 Eloquent Relationship -


I am trying to print a page that shows to all users that users are registered for an event "Officers" are defined as if they have the privilege to be present, and each officer is a student (but a student may possess any position in more than one club).

These are my relationships:

  Class Official Extra Extensible {Secure $ table = "Official Events"; Public $ timestamp = false; Protected $ primaryKey = "oveventID"; Public Function RSVP () {Return $ this- & gt; Haminde ('official atentrvp', 'event id'); }}  

Official RSVP for Events:

Class OfficerEventRSVP extends clues {secure $ table = "officerEventRSVP"; Public $ timestamp = true; Protected $ primaryKey = "rsvpID"; Public Function Officer Event () {Return $ this- & gt; Affiliation ('official event', 'event id'); } Public Function Officer () {Refund $ this- & gt; Retail ('Officer', 'CWD', 'Officer CWID'); List of officers:
  The class officer is spread in the headlines (protected table = "officials";;}}  

public $ Timestamp = Incorrect; protected $ primaryKey = "cwid"; Public Function Club () {Return $ this-> Affiliation ('Club', 'ClubID');} Public Function Student () {Return $ this- & gt; Affiliation ('Student', 'CWD');} Public Function Officer EventRSVP () {Return $ is-> Many ('OfficerEventRSVP', 'cwid', 'Officer CWID '; Students' tables (all officers are students): student eloquence extended {secure $ table = "students"; public $ timestamp = false; protected $ primaryKey = "Cwid"; Public function officer () {return $ this-> hayeman ('official', 'cwd', 'cwd');}}

I make a question I am stuck in the effort that a) All incidents and RSVPS are received, then B) the officer information (name, email) from those RSVPs

I have yet received it, but when I run it, I am receiving a white page:

  $ officerEvents = OfficerEvent :: with ('rsvp') - & gt; Find (); Foreign Currency ($ officer $ officer agent as agent) {foreach ($ officer agency- RCVP as RSVP) (as foreach ($ rsvp- & official;)) {var_dump ($ official- & Gt; student ()); }}}}  

If each officer is a student, the relationship is the same, There is not many syntax remains the same, but it does a straightforward hope on a connection.

Have you set that key as indexed in the migration properly?


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -