PHPackages                             tooshay/laravel-model-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. tooshay/laravel-model-search

ActiveLibrary

tooshay/laravel-model-search
============================

Handy macro for searching text through related models.

02PHP

Since Mar 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/tooshay/laravel-model-search)[ Packagist](https://packagist.org/packages/tooshay/laravel-model-search)[ RSS](/packages/tooshay-laravel-model-search/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Handy macro for searching text through related models.
======================================================

[](#handy-macro-for-searching-text-through-related-models)

[![Latest Version on Packagist](https://camo.githubusercontent.com/416f1b2fea80653683b26a722e60745f78bcf32e9b77bf87832e3ad1f7d6e07e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6f736861792f6c61726176656c2d6d6f64656c2d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tooshay/laravel-model-search)[![GitHub Tests Action Status](https://camo.githubusercontent.com/83ebdebfa63038acf0f74a30f844dc427a4768e91c9bdde2b140b6cd600486e3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f746f6f736861792f6c61726176656c2d6d6f64656c2d7365617263682f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/tooshay/laravel-model-search/actions?query=workflow%3ATests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/84ac7fc1c7c6e123868010fc311dfe43b0f974267d8cc7a4b670d1a092ca5d30/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f746f6f736861792f6c61726176656c2d6d6f64656c2d7365617263682f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/tooshay/laravel-model-search/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/388431213adba6a901fd49f0c0a8bdace4739b6a5e4f256673c246a0b1e83a10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6f736861792f6c61726176656c2d6d6f64656c2d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tooshay/laravel-model-search)

This is a riff on [Freek Spatie's model search macro](https://freek.dev/1182-searching-models-using-a-where-like-query-in-laravel) that adds support for multiple search terms.

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

[](#installation)

You can install the package via composer:

```
composer require tooshay/laravel-model-search
```

Usage
-----

[](#usage)

```
$results = Product::whereLike(['name', 'type.name', 'tags.name'], 'SearchTerm')->get();
```

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)

- [Roy Shay](https://github.com/tooshay)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

16

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1358cae4c0e7b83e80db463e4b990487aa6bdcfa3db9dc4dc0b035a8a7c13746?d=identicon)[tooshay](/maintainers/tooshay)

---

Top Contributors

[![tooshay](https://avatars.githubusercontent.com/u/703589?v=4)](https://github.com/tooshay "tooshay (5 commits)")

### Embed Badge

![Health badge](/badges/tooshay-laravel-model-search/health.svg)

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

PHPackages © 2026

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