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

ActiveLibrary

decorate/searchable
===================

search support

v1.2.0(6y ago)0381MITPHP

Since Jun 19Pushed 6y agoCompare

[ Source](https://github.com/decorate/Searchable)[ Packagist](https://packagist.org/packages/decorate/searchable)[ RSS](/packages/decorate-searchable/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (6)Used By (1)

Searchable
----------

[](#searchable)

This is a Laravel search support package like a validator

### Installation

[](#installation)

With composer:

```
composer require decorate/searchable

```

### Command Examples

[](#command-examples)

```
[
    'name' => '>=',
    'name2' => ['>='],
    'name3' => ['name' => '='],
    'name4' => 'like:name',
    'name5' => 'like_forward:name',
    'name6' => 'like_backward:name',
    'name7' => function(Builder $q, $value) {
        $q->whereNotNull($value);
    },
    'name8' => ['name' => function(Builder $q, $value) {
        $q->where('id', $value);
    }],
    'title' => 'like:detail.title',
    'title2' => ['detail.title' => '='],
    'title3' => ['detail.title' => function(Builder $q, $value) {
        $q->where('age', '>=', $value);
    }],
    'title4' => 'like:detail.',
    'startDate' => 'between:begin_time',
    'endDate' => 'between_end:begin_time',
    'level' => 'in:level_id',
    'level2' => 'in:detail.level_id'
];
```

### Usage

[](#usage)

```
class User extends Model {
  use Searchable;

  public function getSearches(){
    return [
      'name' => 'like',
      'detail_name' => 'like:detail.name'
    ];
  }
}
```

```
class UsersController extends Controller {

  public function index(Request $request) {
    return User::search($request);
  }

}
```

### injection search

[](#injection-search)

```
protected function injectSearch(Builder $builder, Request $request){
  $builder->where('id', '=', $request->query('id'));
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

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

Total

5

Last Release

2311d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8308c95439e9e0d8de48f97174b483a2dcad911f0511e5879e1e9adc64bff30?d=identicon)[team-decorate](/maintainers/team-decorate)

![](https://www.gravatar.com/avatar/da56ae75563ddea7479169dce2aa12fcbbd47aa400cfce4aa18b6ea9741d273b?d=identicon)[mitu2687sp](/maintainers/mitu2687sp)

---

Top Contributors

[![mitu2687sp](https://avatars.githubusercontent.com/u/27335928?v=4)](https://github.com/mitu2687sp "mitu2687sp (12 commits)")

### Embed Badge

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

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

PHPackages © 2026

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