Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Well, it turns out that the filtering is done by using whereDoesntHave, leaving the solution here for future reference.

        $posts = Post::with('tags')->whereDoesntHave('tags', function ($q) {
            $q->where('name', '=', 'is-project');
        })->where('published_at', '!=', 'null')->orderBy('created_at', 'desc')->paginate(3);
0

Sign in to participate in this thread!

Eventy

Your banner here too?

stef stef Joined 14 Jan 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.