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(8y ago)0151MITPHPPHP &gt;=7.0

Since Jul 23Pushed 8y 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 4w ago

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 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

2944d 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

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k14.6M301](/packages/cviebrock-eloquent-sluggable)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.9M109](/packages/mongodb-laravel-mongodb)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k5.2M39](/packages/tucker-eric-eloquentfilter)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k35.7M51](/packages/kirschbaum-development-eloquent-power-joins)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)

PHPackages © 2026

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