kayacekovic / nova-text-filter
Adds a text filter component for resources and lenses.
1.1
2021-01-27 09:23 UTC
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2025-03-27 18:34:25 UTC
README
Installation
You can install the package in to a Laravel app that uses Nova via composer:
composer require kayacekovic/nova-text-filter
Usage
Create a new filter and extend the abstract text filter:
<?php namespace App\Nova\Filters; use Reedware\NovaTextFilter\TextFilter; class MyFilter extends TextFilter { /** * Apply the filter to the given query. * * @param \Illuminate\Http\Request $request * @param \Illuminate\Database\Eloquent\Builder $query * @param mixed $value * @return \Illuminate\Database\Eloquent\Builder */ public function apply(Request $request, $query, $value) { return $query->where('my_column', 'like', "{$value}%"); } }