use isEmpty on database query result

This commit is contained in:
Pig Fang 2018-07-11 16:11:52 +08:00
parent 16c2ba8b64
commit 79746f9e81

View File

@ -41,7 +41,7 @@ class Closet
$this->db = DB::table('closets');
// Create a new closet if not exists
if (! $this->db->where('uid', $uid)->get()) {
if ($this->db->where('uid', $uid)->isEmpty()) {
$this->db->insert([
'uid' => $uid,
'textures' => '[]'