From c98a3feb74fd6debcc3a7220cd44ef2d83eb92bf Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Fri, 18 Oct 2024 21:20:50 +0900 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E8=88=97=E5=89=8A=E9=99=A4=E3=83=AD?= =?UTF-8?q?=E3=82=B8=E3=83=83=E3=82=AF=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Logics/Shop/ShopLogic.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Logics/Shop/ShopLogic.php b/app/Logics/Shop/ShopLogic.php index cfd2390..abdd6d8 100644 --- a/app/Logics/Shop/ShopLogic.php +++ b/app/Logics/Shop/ShopLogic.php @@ -37,8 +37,12 @@ class ShopLogic { $shop->delete(); - foreach ($shop->users as $user) { - $user->delete(); + $users = $shop->users; + + if ($users !== null) { + foreach ($shop->users as $user) { + $user->delete(); + } } } }