PHPackages                             ditscheri/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. [Search &amp; Filtering](/categories/search)
4. /
5. ditscheri/eloquent-search

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

ditscheri/eloquent-search
=========================

This is my package EloquentSearch

0.0.5(2y ago)0812[1 PRs](https://github.com/ditscheri/eloquent-search/pulls)MITPHPPHP ^8.0

Since Jun 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ditscheri/eloquent-search)[ Packagist](https://packagist.org/packages/ditscheri/eloquent-search)[ Docs](https://github.com/ditscheri/eloquent-search)[ GitHub Sponsors](https://github.com/ditscheri)[ RSS](/packages/ditscheri-eloquent-search/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (11)Versions (9)Used By (0)

**PACKAGE IN DEVELOPMENT, DO NOT USE YET**

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

[](#eloquent-search)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fa43ec0572e3ef4ab008dc80f537d17ccf88f3fcd201828496eebd735cf0da81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6469747363686572692f656c6f7175656e742d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ditscheri/eloquent-search)[![GitHub Tests Action Status](https://camo.githubusercontent.com/150c3a0004bde62233b908a4e9dfb2fc90a357c58acb5dd4ab64da2f938fec98/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6469747363686572692f656c6f7175656e742d7365617263682f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/ditscheri/eloquent-search/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/f9c86733a6120fbe202103e99f28a9b3cc3da4f9d8e98f60883e09ec5fa8eb9a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6469747363686572692f656c6f7175656e742d7365617263682f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/ditscheri/eloquent-search/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/7f4d45f61fc4e4f4e23869213737948b4e5966283795582dbaec46f3a2c6e3fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6469747363686572692f656c6f7175656e742d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ditscheri/eloquent-search)

This package lets you perform fast and local searches on your Eloquent Models. You can search foreign columns of related models too.

The approach is based on a gist by Jonathan Reinink ().

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

[](#installation)

You can install the package via composer:

```
composer require ditscheri/eloquent-search
```

Usage
-----

[](#usage)

```
class Podcast extends Model
{
    use \Ditscheri\EloquentSearch\Searchable;

    /**
     * The attributes that are searchable.
     *
     * @var string[]
     */
    protected array $searchable = [
        'title', // make sure to add proper indexes to each of these columns
        'description',
        'author.first_name',
        'author.last_name',
        'comments.message',
        'series.title',
        'series.tags.name',
    ];

    public function author()
    {
        return $this->belongsTo(User::class);
    }

    public function comments()
    {
        return $this->hasMany(Comment::class);
    }

    public function series()
    {
        return $this->belongsTo(Series::class);
    }
}

class PodcastController
{
    public function index(Request $request)
    {
        return Podcast::search($request->input('q', null))->paginate();
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Daniel Bakan](https://github.com/dbakan)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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 ~236 days

Total

5

Last Release

837d ago

PHP version history (3 changes)0.0.1PHP ^7.4

0.0.2PHP ^7.4|^8.0

0.0.4PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bdde3bbcf564c64107c3df5cca4d8433ecade49248f7d8d0b302d0437e5b63d?d=identicon)[ditscheri](/maintainers/ditscheri)

---

Top Contributors

[![dbakan](https://avatars.githubusercontent.com/u/4498077?v=4)](https://github.com/dbakan "dbakan (28 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laraveleloquent-searchditscheri

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-site-search

A site search engine

300129.1k](/packages/spatie-laravel-site-search)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[ajcastro/searchable

Pattern-matching search for Laravel eloquent models.

2847.7k](/packages/ajcastro-searchable)[codewithdennis/filament-price-filter

A simple and customizable price filter for FilamentPHP, allowing users to easily refine results based on specified price ranges.

163.2k](/packages/codewithdennis-filament-price-filter)[eightynine/filament-docs

Elegant documentation system for your Filament application with search, navigation, and markdown support

122.5k1](/packages/eightynine-filament-docs)

PHPackages © 2026

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