{{$post->title}}
{{$post->body}}
+{{$post->body}}
diff --git a/app/Http/Controllers/Community.php b/app/Http/Controllers/Community.php index e3e876c5..a9169272 100644 --- a/app/Http/Controllers/Community.php +++ b/app/Http/Controllers/Community.php @@ -137,4 +137,21 @@ public function leaveSubject($id) //POST REQUEST return redirect(route('community')); } + + public function updatePost($id, Request $request) + { + $post = Post::query()->where('posts.id', $id); + + $title = $request->input('title'); + $body = $request->input('body'); + + $post->update( + [ + 'title' => $title, + 'body' => $body + ] + ); + + return redirect(route('community')); + } } diff --git a/resources/views/community.blade.php b/resources/views/community.blade.php index 0d20bd2c..0fa32407 100644 --- a/resources/views/community.blade.php +++ b/resources/views/community.blade.php @@ -256,7 +256,7 @@ class="bg-transparent absolute inset-x-0 bottom-0 h-0.5">
{{$post->body}}
+{{$post->body}}