| @@ 51-61 (lines=11) @@ | ||
| 48 | //return redirect()->route('blog.index'); |
|
| 49 | } |
|
| 50 | ||
| 51 | public function show(Blog $blog) |
|
| 52 | { |
|
| 53 | $article = $blog; |
|
| 54 | $current_user = Auth::user(); |
|
| 55 | $id_blog = $article->id; |
|
| 56 | // return response()->json([ |
|
| 57 | // 'articles' => $article, |
|
| 58 | // 'current_user' => $current_user |
|
| 59 | // ]); |
|
| 60 | return view('view::show', compact('article', 'current_user', 'id_blog')); |
|
| 61 | } |
|
| 62 | ||
| 63 | public function edit($id) |
|
| 64 | { |
|
| @@ 63-73 (lines=11) @@ | ||
| 60 | return view('view::show', compact('article', 'current_user', 'id_blog')); |
|
| 61 | } |
|
| 62 | ||
| 63 | public function edit($id) |
|
| 64 | { |
|
| 65 | $tags = NULL; |
|
| 66 | $article = Blog::findOrFail($id); |
|
| 67 | $id_blog = $id; |
|
| 68 | // return response()->json([ |
|
| 69 | // 'articles' => $article, |
|
| 70 | // 'tags' => $tags |
|
| 71 | // ]); |
|
| 72 | return view('view::edit', compact('article', 'tags', 'id_blog')); |
|
| 73 | } |
|
| 74 | ||
| 75 | public function update(UpdateBlogPost $request, $id) |
|
| 76 | { |
|