Answers for "laravel eager loading closure"

PHP
0

laravel eager loading closure

// with load
return $packageItem->load(['answers' => function ($query) use ($userId) {
            $query->where('user_id', $userId);
        }]);

// with with ;)
Entry::with(array(
    'foo' => function($query) use ($id) {
        $query->where('user_id', $id);
    },
    'author',
    'lastModifiedBy'
))->...;


$x = $widget->objGallery->galleryItems()->with(array('captions' => 
      function($query){ $query->where('locale', $id );
     }))->get();
Posted by: Guest on September-16-2021

Browse Popular Code Answers by Language