Support the ongoing development of Laravel.io →
Eloquent Database

Hi I am trying to make a filter in laravel nova that allows me to select items that have a relation.

Basically I created a new filter and tried this:

public function apply(Request $request, $query, $value) { return $query->has('vendorproducts'); }

It didn't work. What is wrong?

Last updated 3 years ago.
0

This looks fine. Check if the apply methods gets called.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Ariel draidel Joined 28 Apr 2020

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.

© 2025 Laravel.io - All rights reserved.