From da8af95043aef352733c9888bf5d090d822baf92 Mon Sep 17 00:00:00 2001 From: shibafu Date: Mon, 25 May 2020 00:57:52 +0900 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=94=BB=E9=9D=A2=E3=81=AE?= =?UTF-8?q?=E3=81=8A=E7=9F=A5=E3=82=89=E3=81=9B=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=82=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8B=E3=81=A3?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/InfoController.php | 6 ++---- resources/views/admin/info/index.blade.php | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Admin/InfoController.php b/app/Http/Controllers/Admin/InfoController.php index faf2909..adcf776 100644 --- a/app/Http/Controllers/Admin/InfoController.php +++ b/app/Http/Controllers/Admin/InfoController.php @@ -44,12 +44,10 @@ class InfoController extends Controller return redirect()->route('admin.info.edit', ['info' => $info])->with('status', 'お知らせを更新しました。'); } - public function edit($id) + public function edit(Information $info) { - $information = Information::findOrFail($id); - return view('admin.info.edit')->with([ - 'info' => $information, + 'info' => $info, 'categories' => Information::CATEGORIES ]); } diff --git a/resources/views/admin/info/index.blade.php b/resources/views/admin/info/index.blade.php index 8d5ae40..8f60e66 100644 --- a/resources/views/admin/info/index.blade.php +++ b/resources/views/admin/info/index.blade.php @@ -27,7 +27,7 @@ {{ $categories[$info->category]['label'] }} - {{ $info->title }} + {{ $info->title }} {{ $info->created_at->format('Y年n月j日') }} @@ -54,4 +54,4 @@ -@endsection \ No newline at end of file +@endsection