PHP code example of reedware / nova-text-filter

1. Go to this page and download the library: Download reedware/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/ */

    

reedware / 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}%");
    }
}