Tag field - filter values #5903
Unanswered
lukaszradziak
asked this question in
Q&A
Replies: 2 comments
-
I ran into something similar and solved it this way: protected static function booted()
{
//only return active tags
static::addGlobalScope('active', function ($query) {
$query->where('active', 1);
});
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
another solution for this Tag::make(__('Addons'), 'addons', Addon::class)
->preload(), Addon Resource class public static function indexQuery(NovaRequest $request, $query)
{
if ($request instanceof ResourceSearchRequest) {
return $query->where('is_active', true);
}
} using this the resource will be shown in index request |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How to filter values in Tag field? I try relatableQuery as BelongsTo field but not work.
Tag::make(__('Tags'), 'tags', Tag::class)->preload(),
and in Tag.php:
Beta Was this translation helpful? Give feedback.
All reactions