Creo que termine con el admin del post
This commit is contained in:
@@ -24,13 +24,24 @@ class PostController extends Controller
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
return view('admin.posts.edit', ['post' => Post::find($id)]);
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$post = Post::find($id);
|
||||
|
||||
$post->title = $request->title;
|
||||
$post->md = $request->md;
|
||||
$post->update();
|
||||
|
||||
return redirect()->route('admin.post.index');
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$post = Post::find($id);
|
||||
$post->delete();
|
||||
return redirect()->route('admin.post.index');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user