PHP code example of kayacekovic / nova-text-filter
1. Go to this page and download the library: Download kayacekovic/nova-text-filter library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kayacekovic / nova-text-filter example snippets
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}%");
}
}