PHPackages                             wang-tech-commits/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. wang-tech-commits/laravel-searchable

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

wang-tech-commits/laravel-searchable
====================================

laravel全局搜索

1.0.5(4y ago)09MITPHPPHP ^7.4|^8.0

Since Aug 17Pushed 4y ago1 watchersCompare

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

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

laravel-searchable
==================

[](#laravel-searchable)

Requirement
-----------

[](#requirement)

1. PHP &gt;= 7.4
2. laravel/framework &gt;= 6.0|7.0|8.0

Installing
----------

[](#installing)

```
$ composer require wang-tech-commits/laravel-searchable -vvv
```

Optional, you can publish the config file:

```
$ php artisan vendor:publish --provider="MrwangTc\Searchable\ServiceProvider" --tag=config
```

And if you want to custom the migration of the versions table, you can publish the migration file to your database path:

```
$ php artisan vendor:publish --provider="MrwangTc\Searchable\ServiceProvider" --tag=migrations
```

> After you published the migration files, please update `'migrations' => false` in the config file `config/searchable.php` to disable load the package migrations.

Then run this command to create a database migration:

```
$ php artisan migrate
```

Usage
-----

[](#usage)

Add `MrwangTc\Searchable\Searchable` trait to the model and set searchable attributes:

```
use MrwangTc\Searchable\Searchable;

class Article extends Model
{
    use Searchable;

    public static function boot() {
        parent::boot();

        static::saved(function($model) {
            // 文章关键字，可选参数；
            $keywords = '';
            $model->searchForModel($keywords);
        });
    }

}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

6

Last Release

1727d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/813928f7998d20638a484b3230a78447e952f22f295b0a74c4562f6549e5afbe?d=identicon)[Mrwang-tech-commits](/maintainers/Mrwang-tech-commits)

---

Top Contributors

[![wang-tech-commits](https://avatars.githubusercontent.com/u/74225283?v=4)](https://github.com/wang-tech-commits "wang-tech-commits (11 commits)")

### Embed Badge

![Health badge](/badges/wang-tech-commits-laravel-searchable/health.svg)

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

###  Alternatives

[mehradsadeghi/laravel-filter-querystring

Filter your queries based on url query string parameters like a breeze.

169118.2k](/packages/mehradsadeghi-laravel-filter-querystring)[pos-lifestyle/laravel-nova-date-range-filter

A Laravel Nova date range filter.

16179.1k](/packages/pos-lifestyle-laravel-nova-date-range-filter)[omure/scout-advanced-meilisearch

Laravel Scout extension that allows to use meilisearch advanced features as well as has an extended collection driver for testing purposes.

123.9k](/packages/omure-scout-advanced-meilisearch)

PHPackages © 2026

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