Skip to content

warcooft/codeigniter-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codeigniter Search

Rapid Search for Codeigniter 4 framework

CodeIgniter PHP Version Require

Installation

composer require aselsan/search

Usage

use SearchTrait in your model, as follows:

<?php

namespace App\Models;

use CodeIgniter\Model;

class UserModel extends Model
{
    use SearchTrait; //Add this

    // Optional properties
    protected $search = ['first_name', 'last_name'];

Somewhere in your controller

$keyword = "jhon doe";

// Match any fields
model(UserModel::class)->search($keyword)->paginate();

// Match all fields
model(UserModel::class)->search($keyword, true)->paginate();

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Rapid Search for Codeigniter 4 framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages