Skip to content

Commit

Permalink
fix post controller query
Browse files Browse the repository at this point in the history
  • Loading branch information
levijackson committed Jun 25, 2021
1 parent 3ef54dd commit f9684de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Controllers/PostController.php
Expand Up @@ -12,7 +12,8 @@ class PostController extends Controller
public function index()
{
$posts = Post::where('active', 1)
->orderBy('created_at','desc');
->orderBy('created_at','desc')
->get();

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

0 comments on commit f9684de

Please sign in to comment.