<?php namespace App\Http\Controllers; use App\Models\Post; class BlogController extends Controller { public function index() { return view('blog.index', [ 'blogPosts' => Post::where('type', 'blog')->orderBy('created_at', 'desc') ->paginate(5) ]); } }