@@ 34-41 (lines=8) @@ | ||
31 | * |
|
32 | * @return \Illuminate\Http\Response |
|
33 | */ |
|
34 | public function index() |
|
35 | { |
|
36 | $posts = Blog::getPostsRepository()->OrderBy('created_at')->get(); |
|
37 | $categories = Blog::getCategoriesRepository()->OrderBy('created_at')->get(); |
|
38 | $subTitle = null; |
|
39 | ||
40 | return view('public.blog.list', compact('posts', 'categories', 'subTitle')); |
|
41 | } |
|
42 | ||
43 | public function show($id) |
|
44 | { |
|
@@ 43-50 (lines=8) @@ | ||
40 | return view('public.blog.list', compact('posts', 'categories', 'subTitle')); |
|
41 | } |
|
42 | ||
43 | public function show($id) |
|
44 | { |
|
45 | $post = Blog::getPostsRepository()->findOrFail($id); |
|
46 | $categories = Blog::getCategoriesRepository()->OrderBy('created_at')->get(); |
|
47 | ||
48 | // Show the page |
|
49 | return View('public.blog.post', compact('post', 'categories')); |
|
50 | } |
|
51 | ||
52 | public function showByCategory($id) |
|
53 | { |