PHPackages                             appslabke/laravel-easy-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. appslabke/laravel-easy-search

ActiveLibrary[Search &amp; Filtering](/categories/search)

appslabke/laravel-easy-search
=============================

Simplified Laravel search

v0.3.2(5y ago)2806MITPHPPHP ^7.1|8.0CI failing

Since Sep 12Pushed 5y ago2 watchersCompare

[ Source](https://github.com/AppsLab-KE/laravel-easy-search)[ Packagist](https://packagist.org/packages/appslabke/laravel-easy-search)[ Docs](https://github.com/AppsLab-KE/laravel-easy-search)[ RSS](/packages/appslabke-laravel-easy-search/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (25)Used By (0)

Laravel Easy Search
===================

[](#laravel-easy-search)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a11d3f3aadb20e35b7d3df7ae3e39bd9ad74299645fc5052bd999e7a04573943/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617070736c61626b652f6c61726176656c2d656173792d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appslabke/laravel-easy-search)[![Build Status](https://camo.githubusercontent.com/9f3344ed80dc2bd78588cd6649911367560922eb00094b50e6fa94fe4f27ccac/68747470733a2f2f7472617669732d63692e6f72672f417070734c61622d4b452f6c61726176656c2d656173792d7365617263682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AppsLab-KE/laravel-easy-search)[![Total Downloads](https://camo.githubusercontent.com/7f6909f47411576e1cbc5f2cfedb468f8450496911dd870f60273301a6efc2f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617070736c61626b652f6c61726176656c2d656173792d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/appslabke/laravel-easy-search)

This is where your description should go. Try and limit it to a paragraph or two. Consider adding a small example.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require appslabke/laravel-easy-search
```

Usage
-----

[](#usage)

Add config `vendor:publish --provider="AppsLab\LaravelEasySearch\LaravelEasySearchBaseServiceProvider"`This will add the config file which you can customize `namespace` = allow you to set you filter and module namespace, `location` = allow to set the location for your filter and model `autogenerate-query-builds` = This help in autogenerating query build it is used by filter command to auto generate filter query `queries-types` = this is used to auto complete query type

How to add your own builder.

- Create new service provider `BuildServiceProvider`
- Under boot method add you builds using Search Facede as shown

```
Search::builds([
  NameBuild::class
])
```

Don't forget to add your service provider to app.config providers `App\Providers\BuildServiceProvider::class,`

Working with Laravel Easy Search

- add search on model
- Global search

    - This allow you to search all the columns in the table.
    - Laravel easy search will search the table only with the filters generated on production but will through an error on local/development.
    - If you want to ignore some columns you can second arguments to ignore the columns.

    ```
    ->allowedColumns(['id', 'created_at', 'updated_at'])
    ```

    - by default global search users `search` as the query filter you can replace that by adding the first parameter

    ```
    ->searchAllColumns('filter')
    ```

    Make sure you check the

Add Searchable trait to your model

You can now use Laravel searchable as

```
//First make sure you extend Search facade on your controller

use AppsLab\LaravelEasySearch\Facades\Search;

class NameController extends Controller
{
    public index(){
    $results = Search::model(Model::class)
    //Allowed Collumns methods guide you to search only columns added by default if you don't add allowedColumn all solumns will be return
                ->allowedColumns(['name'])
                //Applying filter from your request
                ->applyFilter() //This will search using the filters you generated if filter is not available it will throw a class does not exist error. You can change the filter from the request by adding an array with the key as the filter and the value as the request key
                ->applyFilter(['search_name' => 'name']) This will replace the search_name with name. Name is the filter name
                //Sort by allow you to sort the result pass an array
                ->sortBy('column','ASC')
                //Do you want to add a query? yeah you can do that by building your query connect to the model
                ->buildQuery('whereHas', ['warehouse', function(Builder $query){
                        $query->where('name' , 'like', '%neo%');
                    }])
                //You can add relation addRelation as string or array
                ->addRelation('users')
                // use first to get first item on search
                ->first()

    }
}
```

```
use Searchable;
```

```
$skeleton = new Spatie\Skeleton();
echo $skeleton->echoPhrase('Hello, Spatie!');
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Marvin Collins Hosea](https://github.com/marvinhosea)
- [All Contributors](../../contributors)

Support us
----------

[](#support-us)

We are a mixture of technologists, analysts and designers pushing boundaries of what’s possible in problem solving for businesses and communities, and while we are at it we have fun. [Apps:Lab KE](https://appslab.co.ke/)

Mpesa Contribution
------------------

[](#mpesa-contribution)

coming soon

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~35 days

Total

21

Last Release

1922d ago

PHP version history (2 changes)v0.0.1PHP ^7.1

v0.3.1PHP ^7.1|8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f35754bfa456e30318a56ef5418b235940e365de3e0c58a85c8cd32f82244c84?d=identicon)[marvin\_hosea](/maintainers/marvin_hosea)

---

Top Contributors

[![marvinhosea](https://avatars.githubusercontent.com/u/7722584?v=4)](https://github.com/marvinhosea "marvinhosea (69 commits)")

---

Tags

appslablarave-searchlaravellaravel-packagephplaravel-searchappslablaravel-easy-search

### Embed Badge

![Health badge](/badges/appslabke-laravel-easy-search/health.svg)

```
[![Health](https://phpackages.com/badges/appslabke-laravel-easy-search/health.svg)](https://phpackages.com/packages/appslabke-laravel-easy-search)
```

###  Alternatives

[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[loupe/loupe

A full text search engine with tokenization, stemming, typo tolerance, filters and geo support based on only PHP and SQLite

497185.2k14](/packages/loupe-loupe)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[shopware/elasticsearch

Elasticsearch for Shopware

153.6M8](/packages/shopware-elasticsearch)[getcandy/candy-api

API driven E-commerce solution, written in Laravel

4427.9k1](/packages/getcandy-candy-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
