From 2c45b22b6f4cf20a866bb267470ec210834b70ee Mon Sep 17 00:00:00 2001 From: Nnaemeka Onukwube Date: Sat, 29 Jun 2024 02:20:15 -1200 Subject: [PATCH] update controllers --- app/Http/Controllers/PostController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index cc048e4..f7bd722 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -31,6 +31,7 @@ public function index() */ public function store(Request $request) { + return Post::create($request->all()); } /** @@ -41,6 +42,7 @@ public function store(Request $request) */ public function show(Post $post) { + return $post; } /** @@ -52,6 +54,8 @@ public function show(Post $post) */ public function update(Request $request, Post $post) { + $post->update($request->all()); + return $post; } /** @@ -62,5 +66,6 @@ public function update(Request $request, Post $post) */ public function destroy(Post $post) { + return $post->delete(); } }