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 3w ago

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

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

1779d 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

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.6k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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