@@ 34-40 (lines=7) @@ | ||
31 | return redirect()->route('categories'); |
|
32 | } |
|
33 | ||
34 | public function show(Category $category) |
|
35 | { |
|
36 | $item = $category; |
|
37 | $posts = LaravelBlog::where('published', '=', true)->where('category_id', '=', $item->id)->orderBy('published_at', 'desc')->get(); |
|
38 | ||
39 | return view('laravel-blog::archive', compact('item', 'posts')); |
|
40 | } |
|
41 | ||
42 | public function edit(Category $category) |
|
43 | { |
@@ 232-238 (lines=7) @@ | ||
229 | return view('laravel-blog::blog_admin', compact('posts')); |
|
230 | } |
|
231 | ||
232 | public function indexAuthor($user_name) |
|
233 | { |
|
234 | $item = User::where('name', '=', $user_name)->first(); |
|
235 | $posts = LaravelBlog::where('published', '=', true)->where('user_id', '=', $item->id)->orderBy('published_at', 'desc')->get(); |
|
236 | ||
237 | return view('laravel-blog::archive', compact('item', 'posts')); |
|
238 | } |
|
239 | } |
|
240 |