Skip to content

Commit f9684de

Browse files
committed
fix post controller query
1 parent 3ef54dd commit f9684de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/Http/Controllers/PostController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class PostController extends Controller
1212
public function index()
1313
{
1414
$posts = Post::where('active', 1)
15-
->orderBy('created_at','desc');
15+
->orderBy('created_at','desc')
16+
->get();
1617

1718
//return blog.blade.php template from resources/views folder
1819
return view('blog.index', ['posts' => $posts, 'title' => 'Blog Posts']);

0 commit comments

Comments
 (0)