PHPackages                             jhacobs/laravel-searchable - 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. jhacobs/laravel-searchable

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

jhacobs/laravel-searchable
==========================

Search through models

v1.0.0(4y ago)15MITPHPPHP ^7.4|^8.0

Since Sep 19Pushed 4y ago2 watchersCompare

[ Source](https://github.com/jhacobs/laravel-searchable)[ Packagist](https://packagist.org/packages/jhacobs/laravel-searchable)[ RSS](/packages/jhacobs-laravel-searchable/feed)WikiDiscussions main Synced today

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

Laravel searchable
==================

[](#laravel-searchable)

[![Packagist Version](https://camo.githubusercontent.com/aa4c69d2b20d490a50230b28eec57e1f053237baf4d043529b65f6a7f2129b43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6861636f62732f6c61726176656c2d73656172636861626c65)](https://camo.githubusercontent.com/aa4c69d2b20d490a50230b28eec57e1f053237baf4d043529b65f6a7f2129b43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6861636f62732f6c61726176656c2d73656172636861626c65)[![GitHub PHP Workflow](https://github.com/jhacobs/laravel-searchable/actions/workflows/php.yml/badge.svg)](https://github.com/jhacobs/laravel-searchable/actions/workflows/php.yml/badge.svg)

Search through models with laravel searchable

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

[](#installation)

You can install the package via composer

```
  composer require jhacobs/laravel-searchable
```

Usage/Examples
--------------

[](#usageexamples)

### Prepare your models

[](#prepare-your-models)

Add the `Searchable` trait to the model you want to search through.

```
namespace App\Models\User;

use Illuminate\Database\Eloquent\Model;
use Jhacobs\Searchable\Searchable;

class User extends Model
{
    use Searchable;
}
```

Then add the fields you want to be searchable to the `$searchables` property.

```
namespace App\Models\User;

use Illuminate\Database\Eloquent\Model;
use Jhacobs\Searchable\Searchable;

class User extends Model
{
    use Searchable;

    protected $searchables = [
        'name',
        'email'
    ];
}
```

### Searching models

[](#searching-models)

You can search through your models by using the search scope.

```
User::search('Henk')
    ->get();
```

Running Tests
-------------

[](#running-tests)

To run tests, run the following command

```
  composer test
```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

1749d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14801904?v=4)[Jacob Aretz](/maintainers/jhacobs)[@jhacobs](https://github.com/jhacobs)

---

Top Contributors

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

---

Tags

laravellaravel-searchable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jhacobs-laravel-searchable/health.svg)

```
[![Health](https://phpackages.com/badges/jhacobs-laravel-searchable/health.svg)](https://phpackages.com/packages/jhacobs-laravel-searchable)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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