Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. class Order extends Eloquent {
  2. public function lineitem() {
  3. return $this->hasOne('AppModelsLineItem','id','lineitem_id');
  4. }
  5. }
  6. class LineItem extends Eloquent {
  7. public function totals() {
  8. return $this->hasMany("App\Models\LineItemTotal",'lineitem_id');
  9. }
  10. }
  11.  
  12. Collection {#530 ▼
  13. #items: array:7 [▼
  14. 0 => LineItemTotal {#506 ▶}
  15. 1 => LineItemTotal {#531 ▶}
  16. 2 => LineItemTotal {#522 ▶}
  17. 3 => LineItemTotal {#508 ▶}
  18. 4 => LineItemTotal {#509 ▶}
  19. 5 => LineItemTotal {#510 ▶}
  20. 6 => LineItemTotal {#511 ▶}
  21. ]
  22. }
  23.  
  24. dd(isset($order->lineitem->totals));
  25.  
  26. false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement