PHP code example of slash-dw / filter-kit

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

    

slash-dw / filter-kit example snippets


use SlashDw\FilterKit\BaseFilter;
use SlashDw\FilterKit\Enum\Operator;
use SlashDw\FilterKit\FetchType;
use SlashDw\FilterKit\Filterable;

final class ItemFilter extends BaseFilter
{
    #[Filterable(columns: 'title', operator: Operator::ILIKE)]
    public ?string $q = null;
}

$filter = ItemFilter::fromRequest($request)
    ->setFetchType(FetchType::paginate('/items', 30));