PHPackages                             ac-developers/eloquent-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. [Database &amp; ORM](/categories/database)
4. /
5. ac-developers/eloquent-search

ActiveLibrary[Database &amp; ORM](/categories/database)

ac-developers/eloquent-search
=============================

A simple search package for Eloquent.

v1.1(7y ago)0151MITPHPPHP &gt;=7.0

Since Jul 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tsommie/eloquent-search)[ Packagist](https://packagist.org/packages/ac-developers/eloquent-search)[ RSS](/packages/ac-developers-eloquent-search/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Eloquent Search
===============

[](#eloquent-search)

Easy way to search for a keyword in all your eloquent models at once.

> **Note:This package does not support any search driver like ElasticSearch or Agolia**

- [Eloquent Search](#eloquent-search)
    - [1. Installation](#1-installation)
    - [2. Usage](#2-usage)
    - [3. Security Vulnerabilities](#3-security-vulnerabilities)
    - [4. License](#4-license)

1. Installation
---------------

[](#1-installation)

The recommended way to install eloquent search is by using composer.

Run:

```
composer require ac-developers/eloquent-search

```

2. Usage
--------

[](#2-usage)

Implement the `EloquentSearchInterface` in your eloquent model and then also use the `EloquentSearchTrait`, this will require you to implement a `searchColumns` method which should return an array of the columns you would want to search through in the model.

```
class Article implements EloquentSearchInterface
{
    use EloquentSearchTrait;

    /**
     * Return an array of all the columns to search through.
     *
     * @return array
     */
    public function searchColumns():array
    {
        return ['title', 'body', 'summary];
    }
}

```

Then in your controller you would use the the `EloquentSearch` class to find what your looking for. The class takes 5 arguments, but the most important is the first which is the `keyword` you want to search for and then the second is an array of all the `eloquent model` classes you would like to search through.

```
class SearchController extends Controller
{
    /**
     * @param Request $request
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\Support\HtmlString|\Illuminate\View\View
     */
    public function __invoke(Request $request)
    {
        $result = EloquentSearch::search($request->get('q'),[
            Article::class, Users:class, Blog::class
        ]);
    }
}

```

The `EloquentSearch` class will merge and return a paginated collection of all the models searched through using the `Illuminate\Pagination\LengthAwarePaginator` class.

3. Security Vulnerabilities
---------------------------

[](#3-security-vulnerabilities)

If you discover a security vulnerability within Laravel Form Processor, please send an e-mail to Anitche Chisom via . All security vulnerabilities will be promptly addressed.

4. License
----------

[](#4-license)

The Eloquent Search is open-sourced software licensed under the [MIT](LICENSE) license.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~0 days

Total

3

Last Release

2851d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/267c0ebc19a68dd31263dab46f2d5224ac2e1ff1af6fb62e4417c8817f419667?d=identicon)[tsommie](/maintainers/tsommie)

---

Top Contributors

[![tsommie](https://avatars.githubusercontent.com/u/10388658?v=4)](https://github.com/tsommie "tsommie (11 commits)")

---

Tags

searcheloquentAnitche Chisom

### Embed Badge

![Health badge](/badges/ac-developers-eloquent-search/health.svg)

```
[![Health](https://phpackages.com/badges/ac-developers-eloquent-search/health.svg)](https://phpackages.com/packages/ac-developers-eloquent-search)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M253](/packages/cviebrock-eloquent-sluggable)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[mehdi-fathi/eloquent-filter

Eloquent Filter adds custom filters automatically to your Eloquent Models in Laravel.It's easy to use and fully dynamic, just with sending the Query Strings to it.

450191.6k1](/packages/mehdi-fathi-eloquent-filter)[mohammad-fouladgar/eloquent-builder

527189.5k](/packages/mohammad-fouladgar-eloquent-builder)[jedrzej/searchable

Searchable trait for Laravel's Eloquent models - filter your models using request parameters

127259.1k5](/packages/jedrzej-searchable)

PHPackages © 2026

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