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.1.0(1mo ago)0830[4 PRs](https://github.com/ditscheri/eloquent-search/pulls)MITPHPPHP ^8.2CI passing

Since Jun 22Pushed 1w 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 today

READMEChangelog (7)Dependencies (22)Versions (16)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

48

—

FairBetter than 93% of packages

Maintenance94

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 86.8% 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 ~298 days

Total

7

Last Release

45d ago

PHP version history (4 changes)0.0.1PHP ^7.4

0.0.2PHP ^7.4|^8.0

0.0.4PHP ^8.0

0.0.6PHP ^8.2

### 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 (33 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 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

Static AnalysisPHPStan

### 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-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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