Is there a way to retrieve all the records which has not null using eloquent model.
e.g.
我有关系
板块模型
public function project()
{
return $this->hasOne('App\Models\Project');
}
project model
public function plate()
{
return $this->belongsTo('App\Models\Plate');
}
How can I retrieve all the records which have value.
trying this return $p = \App\Models\Plate::with('project')->get();
会退还所有东西,即使是那些有NULL
英镑的人.
我想要的是plates
个有附加项目的项目.我try 了laravel文档,但什么都找不到.many
关系也有同样的方法吗