Guest User

Untitled

a guest
Dec 11th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. --Users
  2. --id
  3. --username
  4. --Posts
  5. --id
  6. --summary
  7. --published
  8. --Images
  9. --id
  10. --link
  11. --alt
  12. --image_id
  13. --image_type
  14.  
  15. public function scopeWithImages()
  16. {
  17. return static::with('images')->get();
  18. }
  19.  
  20. public function images()
  21. {
  22. return $this->morphMany('AppModelsImages', 'image');
  23. }
  24.  
  25. public function scopeWithImages()
  26. {
  27. return static::with('images')->get();
  28. }
  29.  
  30. public function images()
  31. {
  32. return $this->morphMany('AppModelsImages', 'image');
  33. }
  34.  
  35. public function users()
  36. {
  37. return $this->morphedByMany('AppModelsUsers', 'image');
  38. }
  39.  
  40. public function posts()
  41. {
  42. return $this->morphedByMany('AppModelsPosts', 'image');
  43. }
Add Comment
Please, Sign In to add comment