mirhamit / searchable
A Minimal Laravel Search Package
This package is auto-updated.
Last update: 2022-04-13 16:36:53 UTC
README
A Minimal Laravel Search Package
Installation
open terminal and cd to your project root folder
install laravel
Install this package with composer
composer require mirhamit/searchable
Usage
Add HasPermission to your user model in this example we used User model, you can use in any model
use MirHamit\Searchable\Searchable; class User extends Authenticatable { use HasApiTokens, HasFactory, Notifiable, Searchable; ... }
Get your search In this example we used in route and searched a signle user
Route::get('search', function () { return \App\Models\User::search('w1w', 0)->paginate(2); // return \App\Models\User::search($request->input(), 1)->paginate(2); });
The second parameter of search accepts boolean
If you send 0 to second parameter, search will search with orWhere
If you send 1 to second parameter, search will search with where
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review and check security vulnerabilities and report them in issues section.
Credits
License
The MIT License (MIT). Please see License File for more information.