管理画面のお知らせのリンクもおかしかった

This commit is contained in:
shibafu 2020-05-25 00:57:52 +09:00
parent 9fcf9cd49e
commit da8af95043
2 changed files with 4 additions and 6 deletions

View File

@ -44,12 +44,10 @@ class InfoController extends Controller
return redirect()->route('admin.info.edit', ['info' => $info])->with('status', 'お知らせを更新しました。'); 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([ return view('admin.info.edit')->with([
'info' => $information, 'info' => $info,
'categories' => Information::CATEGORIES 'categories' => Information::CATEGORIES
]); ]);
} }

View File

@ -27,7 +27,7 @@
<span class="badge {{ $categories[$info->category]['class'] }}">{{ $categories[$info->category]['label'] }}</span> <span class="badge {{ $categories[$info->category]['class'] }}">{{ $categories[$info->category]['label'] }}</span>
</td> </td>
<td> <td>
<a href="{{ route('admin.info.edit', ['id' => $info->id]) }}">{{ $info->title }}</a> <a href="{{ route('admin.info.edit', ['info' => $info->id]) }}">{{ $info->title }}</a>
</td> </td>
<td> <td>
{{ $info->created_at->format('Y年n月j日') }} {{ $info->created_at->format('Y年n月j日') }}