When using ->get() you cannot simply use any of the below:
代碼: 選擇全部
if (empty($result)) { }
if (!$result) { }
if ($result) { }
To determine if there are any results you can do any of the following:
代碼: 選擇全部
if ($result->first()) { }
if (!$result->isEmpty()) { }
if ($result->count()) { }
if (count($result)) { }