标签:
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‘); }
标签:
原文地址:http://my.oschina.net/u/2444569/blog/531082