agregada la opcion de published a los posts

This commit is contained in:
Daniel Cortés
2019-10-17 08:00:53 -03:00
parent 877477503c
commit 2fcbf51071
8 changed files with 49 additions and 2 deletions

View File

@@ -9,8 +9,11 @@ class BlogController extends Controller
{
public function index()
{
$posts = Post::where('is_published', true)
->orderBy('created_at', 'desc')
->take(3)
->get();
$posts = Post::orderBy('created_at', 'desc')->take(3)->get();
return view('blog.index', ['posts' => $posts] );
}