From 79746f9e8113e57a13309f621d14cf05b0ef7f5a Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 11 Jul 2018 16:11:52 +0800 Subject: [PATCH] use `isEmpty` on database query result --- app/Models/Closet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Closet.php b/app/Models/Closet.php index fed41d83..ac9eeba4 100644 --- a/app/Models/Closet.php +++ b/app/Models/Closet.php @@ -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' => '[]'