1.
find --> è¿å object or empty
ex:
$p = Project::find($id);
if(empty($p)) {
dd('project is empty');
}
get --> è¿åobject , éè¿count æ¹æ³å¤æ
ex:
$p = Project::where('user_id', '=', $userid)->get();
if($p->count() == 0) {
dd('project is empty');
}
温馨提示:答案为网友推荐,仅供参考