From 896d951299eb7f4fa3ca023e722b0d6123cef0a5 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: Wed, 10 Nov 2021 11:34:43 +0900 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/Http/Controllers/Api/ChildrenController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/app/Http/Controllers/Api/ChildrenController.php b/backend/app/Http/Controllers/Api/ChildrenController.php index e47422d7..65f66ffb 100644 --- a/backend/app/Http/Controllers/Api/ChildrenController.php +++ b/backend/app/Http/Controllers/Api/ChildrenController.php @@ -124,6 +124,12 @@ KIKI承知システムを使って「聞いてない!」「言ってない! } $password = Hash::make($r->password); + + $ext = explode('/', mime_content_type($r->image))[1]; + $filename = uniqid() . '.'.$ext; + $image = base64_decode(substr($r->image, strpos($r->image, ',') + 1)); + Storage::disk('public')->put($filename, $image); + $insert = [ 'identity' => $r->identity, 'email' => $r->email, @@ -131,7 +137,7 @@ KIKI承知システムを使って「聞いてない!」「言ってない! 'password' => $password, 'last_name' => $r->last_name, 'first_name' => $r->first_name, - 'image' => $r->image, + 'image' => '/storage/'.$filename, 'company' => $r->company, ];