jianjye / laravel-basic-search
Provide simple search services for laravel application
dev-master
2021-06-05 16:07 UTC
Requires
- php: ^7.2.5|^8.0.0
Requires (Dev)
- calebporzio/sushi: ^2.0
- nesbot/carbon: ^2.31
- orchestra/testbench: ^5.0
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2025-03-06 01:15:55 UTC
README
Provides searching, searching with ranges, and sorting
Installation
You can install the package via composer:
composer require jianjye/laravel-basic-search
Usage
search
- Search with exact match
\LaravelBasicSearch::search($request, $model, $fields, $ranges, $sorts);
fuzzySearch
- Search with partial match %LIKE%
\LaravelBasicSearch::fuzzySearch($request, $model, $fields, $ranges, $sorts);
Searching with custom date
$dates = ['date_field' => 'd-m-Y']; \LaravelBasicSearch::search($request, $model, $fields, $ranges, $sorts, $dates);
Sorting Links (to be used in Blade)
\LaravelBasicSearch::links($request, $sorts);
Sorting Icons (to be used in Blade)
\LaravelBasicSearch::icons($request, $sorts);
Testing
php vendor/phpunit/phpunit/phpunit
Credits
License
The MIT License (MIT). Please see License File for more information.