Skip to content

Commit

Permalink
destroyアクション追加
Browse files Browse the repository at this point in the history
  • Loading branch information
ryotamedx committed Sep 19, 2021
1 parent b5bea34 commit abe1216
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Http/Controllers/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,12 @@ public function update(ItemRequest $request, $id)

return redirect('/items');
}

public function destroy($id)
{
$item = Item::find($id);
$item->delete();

return redirect('/items');
}
}

0 comments on commit abe1216

Please sign in to comment.