Guest User

Untitled

a guest
Jan 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. public function typable()
  2. {
  3. return $this->morphTo();
  4. }
  5.  
  6. public function agency()
  7. {
  8. return $this->belongsTo(agency::class);
  9. }
  10.  
  11. public function actors()
  12. {
  13. return $this->hasMany(Actor::class);
  14. }
  15.  
  16. $user->load(['typable.agency', 'typable.tags']);
  17.  
  18. actor_id , agency_id
  19. 1 , 1
Add Comment
Please, Sign In to add comment