PHPackages                             vluzrmos/eloquent-simple-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. [Database &amp; ORM](/categories/database)
4. /
5. vluzrmos/eloquent-simple-searchable

ActivePackage[Database &amp; ORM](/categories/database)

vluzrmos/eloquent-simple-searchable
===================================

An Eloquent Simple Searchable Scope.

v0.1.1(4y ago)2174MITPHP

Since Sep 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/vluzrmos/eloquent-simple-searchable)[ Packagist](https://packagist.org/packages/vluzrmos/eloquent-simple-searchable)[ RSS](/packages/vluzrmos-eloquent-simple-searchable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (9)Used By (0)

Eloquent Simple Searchable
--------------------------

[](#eloquent-simple-searchable)

[![Latest Stable Version](https://camo.githubusercontent.com/10f68f15d1cec3a87d09560ff4d6e97317b7f4b054d83a8eb8ad02c46200c23d/68747470733a2f2f706f7365722e707567782e6f72672f766c757a726d6f732f656c6f7175656e742d73696d706c652d73656172636861626c652f762f737461626c65)](https://packagist.org/packages/vluzrmos/eloquent-simple-searchable) [![Total Downloads](https://camo.githubusercontent.com/0b9d384be835276e05a24040114b4f01f6a3225fbe5db8129df5e5586c2dc7ae/68747470733a2f2f706f7365722e707567782e6f72672f766c757a726d6f732f656c6f7175656e742d73696d706c652d73656172636861626c652f646f776e6c6f616473)](https://packagist.org/packages/vluzrmos/eloquent-simple-searchable) [![Latest Unstable Version](https://camo.githubusercontent.com/f929abdc7c2a75046edbaf96f31a46e0858dcbab8e4b81e0ef298eabc26658ba/68747470733a2f2f706f7365722e707567782e6f72672f766c757a726d6f732f656c6f7175656e742d73696d706c652d73656172636861626c652f762f756e737461626c65)](https://packagist.org/packages/vluzrmos/eloquent-simple-searchable) [![License](https://camo.githubusercontent.com/e62555e06f881ee7a1c1fc54edaf62f61cd2fe4e3cc9e375ee6ec3b263300a76/68747470733a2f2f706f7365722e707567782e6f72672f766c757a726d6f732f656c6f7175656e742d73696d706c652d73656172636861626c652f6c6963656e7365)](https://packagist.org/packages/vluzrmos/eloquent-simple-searchable)

### Installation

[](#installation)

`composer require vluzrmos/eloquent-simple-searchable`

### Usage

[](#usage)

Put that trait into your model:

```
namespace App;

use Illuminate\Database\Eloquent\Model;
use Vluzrmos\SimpleSearchable\Eloquent\SimpleSearchableTrait;

class User extends Model
{
	use SimpleSearchableTrait;

	protected $searchable = [
		'field' => 'type'
	];
}
```

The attribute $searchable should contain the index with a column or a related column and the value is a type of the search which includes:

- `left_text`: Match the left side of the column value
- `right_text`: Match the right side of the column value
- `equals`: The searchd text should be equals to the column value
- `full_text`: The searched text should be in any position of the searchd column.

### Real Life Usage

[](#real-life-usage)

```
namespace App;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

use Vluzrmos\SimpleSearchable\Eloquent\SimpleSearchableTrait;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
	use Authenticatable, CanResetPassword, SimpleSearchableTrait;

	protected $searchable = [
		'name' => 'full_text',
		'posts.title' => 'full_text',
		// query deeply into your relations, that relations should exists on the respective models.
		'posts.comments.owner.name' => 'full_text'
	];

	public function posts()
	{
		return $this->hasMany(Post::class);
	}
}
```

And in your controller or anywhere:

```
$users = User::search('Jonh')->get();

// or replace the default searchable fields:

$users = User::search('Jonh', ['name' => 'full_text'])->get();
```

> Note: The `search` method is a scope, so you need to use query builder methods like `get` or `all` to perform the search and get a collection of the results.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Every ~362 days

Recently: every ~232 days

Total

7

Last Release

1721d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/450848?v=4)[Vagner Luz do Carmo](/maintainers/vluzrmos)[@vluzrmos](https://github.com/vluzrmos)

---

Top Contributors

[![vluzrmos](https://avatars.githubusercontent.com/u/450848?v=4)](https://github.com/vluzrmos "vluzrmos (13 commits)")

---

Tags

laraveldatabaseeloquent

### Embed Badge

![Health badge](/badges/vluzrmos-eloquent-simple-searchable/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[pdphilip/elasticsearch

An Elasticsearch implementation of Laravel's Eloquent ORM

145360.2k4](/packages/pdphilip-elasticsearch)[mvanduijker/laravel-transactional-model-events

Add eloquent model events fired after a transaction is committed or rolled back

75164.5k](/packages/mvanduijker-laravel-transactional-model-events)[guidocella/eloquent-populator

Guess attributes for Eloquent model factories

7661.6k2](/packages/guidocella-eloquent-populator)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)

PHPackages © 2026

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