2

2 Examples

0
$booking = Booking::with(['meta' => function ($q) {

  // query related table
  $q->where('someFieldOnMetaTypeTable', 'someValue')

    // and / or pivot table
    ->wherePivot('someFieldOnMetaTable', 'anotherValue');

}])->first();
by on

0

$post->user->country (as per the example in the laravel docs)


Other Code Examples