From be126396c85192cc5db2446893b92ca56387b87a Mon Sep 17 00:00:00 2001 From: andes2912 Date: Tue, 29 Mar 2022 00:04:43 +0700 Subject: [PATCH] Bug Fix Update Visi & Misi Backend --- .../Controllers/Backend/Website/VisidanMisiController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Backend/Website/VisidanMisiController.php b/app/Http/Controllers/Backend/Website/VisidanMisiController.php index faa71c3..30e42b1 100644 --- a/app/Http/Controllers/Backend/Website/VisidanMisiController.php +++ b/app/Http/Controllers/Backend/Website/VisidanMisiController.php @@ -101,10 +101,10 @@ public function update(VisidanMisiRequest $request, $id) $image->storeAs($tujuan_upload,$nama_img); } - $visimisi = new Visimisi(); + $visimisi = Visimisi::find($id); $visimisi->visi = $request->visi; $visimisi->misi = $request->misi; - $visimisi->image = $nama_img; + $visimisi->image = $nama_img ?? $visimisi->image; $visimisi->update(); Session::flash('success','Visi dan Misi Berhasil diupdate!');