Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function update(Request $request, Post $post) {
- $this->authorize('update', $post);
- $this->validate($request, [
- 'body' => [
- 'required',
- 'max:250'
- ],
- ]);
- Post::where('id', $request->route('posts'))->update([
- 'content' => $request->body
- ]);
- return back()->with('message', 'Your post has been updated.');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement