Eager loading with parameters - laravel
Sure! The with
method accepts a closure to filter eager loading.
Bank::with(array('service' => function($query){
$query->where('id', 1);
}))->get();
Sure! The with
method accepts a closure to filter eager loading.
Bank::with(array('service' => function($query){
$query->where('id', 1);
}))->get();