From babbe745752cede4558293a7dc4473fac3d5894b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Fri, 29 Oct 2021 21:46:55 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BD=95=E3=81=A7=E3=80=8C->get()->toArray()?= =?UTF-8?q?=E3=80=8D=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=8B=EF=BC=81?= =?UTF-8?q?=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/Http/Controllers/Api/FathersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/Http/Controllers/Api/FathersController.php b/backend/app/Http/Controllers/Api/FathersController.php index d50ddfc4..8a889648 100644 --- a/backend/app/Http/Controllers/Api/FathersController.php +++ b/backend/app/Http/Controllers/Api/FathersController.php @@ -230,7 +230,7 @@ class FathersController extends Controller { public function detail ($father_id) { $father_select = ['image', 'email', 'tel', 'profile', 'company']; - if (null === ($result = Father::select($father_select)->where('id', (int)$father_id)->orderBy('created_at', 'desc')->get()->toArray())) { + if (null === ($result = Father::select($father_select)->where('id', (int)$father_id)->orderBy('created_at', 'desc')->first())) { // 親詳細の取得に失敗 return ['status_code' => 400, 'error_messages' => ['親の更新に失敗しました。']]; }