how to show only published Modules in browser Field?
Hi everyone.
I have a model called customer.
I want to make this customer selectable via the browser field. That works so far. However, it always displays all customers, not just the published ones.
After researching, I tried the following in /app/Repositories/CustomerRepository.php
public function getBrowserItemsQuery($query)
{
return $query->where(“published”, 1);
}
But all of them are still displayed.
The status of whether published or not is also set correctly in the database.
5 Replies
You could do something like this
in your CustomerController
Hi Justin, thank you very much! That worked.
Hi @Justin , Is there a place in the documentation where this is covered? I couldn't find your solution anywhere. It would be great to know this for future problems.
Sadly not, I've just been looking through twill's code
It's a shame that the documentation isn't really helpful with these kinds of problems. Thank you again for your help.
I agree, hopefully things like this will be added in the future when development on this project continues. And no problem!