Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation

Posted 3 years ago by Mubashar

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); }

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.