Rapid Search for Codeigniter 4 framework
composer require aselsan/search
use SearchTrait in your model, as follows:
<?phpnamespaceApp\Models;
useCodeIgniter\Model;
class UserModel extends Model
{
use SearchTrait; //Add this// Optional propertiesprotected$search = ['first_name', 'last_name'];Somewhere in your controller
$keyword = "jhon doe";
// Match any fieldsmodel(UserModel::class)->search($keyword)->paginate();
// Match all fieldsmodel(UserModel::class)->search($keyword)->paginate();This project is licensed under the MIT License - see the LICENSE file for details.