我怎样才能在 Laravel 控制器中实现这样的事情
$results = ModelA::with('model_b')->where('model_b.field_from_model_b',true)->get()
Run Code Online (Sandbox Code Playgroud)
假设我在模型 A 中做了这样的关系
function model_b(){
return $this->hasMany('App\ModelB');
}
Run Code Online (Sandbox Code Playgroud)