I am getting error here but i dont know why?
public function index()
{
//dd('solution');
$posts=Posts::where('active','1')
->orderBy('created_at','desc')
->paginate(5);
$title = 'Latest Posts';
return view('home')->withPosts($posts)->withTitle($title);
}
Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation
I am getting error here but i dont know why? public function index() { //dd('solution'); $posts=Posts::where('active','1') ->orderBy('created_at','desc') ->paginate(5); $title = 'Latest Posts'; return view('home')->withPosts($posts)->withTitle($title); }