Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Order extends Eloquent {
- public function lineitem() {
- return $this->hasOne('AppModelsLineItem','id','lineitem_id');
- }
- }
- class LineItem extends Eloquent {
- public function totals() {
- return $this->hasMany("App\Models\LineItemTotal",'lineitem_id');
- }
- }
- Collection {#530 ▼
- #items: array:7 [▼
- 0 => LineItemTotal {#506 ▶}
- 1 => LineItemTotal {#531 ▶}
- 2 => LineItemTotal {#522 ▶}
- 3 => LineItemTotal {#508 ▶}
- 4 => LineItemTotal {#509 ▶}
- 5 => LineItemTotal {#510 ▶}
- 6 => LineItemTotal {#511 ▶}
- ]
- }
- dd(isset($order->lineitem->totals));
- false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement