PHPackages                             assemble/eloquentsearch - 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. assemble/eloquentsearch

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

assemble/eloquentsearch
=======================

Search and retrieve an eloquent model entity based on complex search criteria from the model relations.

1.5.1(7y ago)12993[1 issues](https://github.com/AssembleOnline/eloquentsearch/issues)MITPHP

Since Feb 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/AssembleOnline/eloquentsearch)[ Packagist](https://packagist.org/packages/assemble/eloquentsearch)[ RSS](/packages/assemble-eloquentsearch/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (1)Versions (9)Used By (0)

Eloquent Model Searcher for Laravel 5
=====================================

[](#eloquent-model-searcher-for-laravel-5)

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

[](#installation)

Add this line to your `providers` array:

```
Assemble\EloquentSearch\EloquentSearchServiceProvider::class,
```

Add this line to your `aliases` array:

```
'EloquentSearch' => Assemble\EloquentSearch\Facades\EloquentSearcher::class,
```

You will need to run `php artisan vendor:publish` to publish the config file to your instalation, Once run, you can find it in `config/eloquenet_search.php`. This config file is used to controll which models are used to search/return entities of.

Configuration
-------------

[](#configuration)

The config file can be found in the laravel config folder at `config/eloquent_search.php`, here you can define the classes related to your models as below.

```
return [
	'search_models' => [
		/*
			Add your searchable eloquent models here, this is an example of user model usage.

			If you have your models sitting in the app root as default, something like this should find them.

				'user' => User::class,

	    	Otherwise if you have them elsewhere or the application cant seem to find them, try prefix them as such.

	    		'user' => App\Models\User::class,

	    */

	    'user' => User::class,

	]
];
```

Usage
-----

[](#usage)

To make use of the search functionality, you will need to implement a `$searchable` property on your models to detail which fields and relations are searchable.

```
/*
*   Searchable Fields
*/
public $searchable = [
    'name', 'user_id', // fields
    'user', 'tags', // relations
];
```

You can also implement the method 'isSearchable' in your models for the searcher to determine if it is allowed to search/return that model.

```
public function isSearchable(){
	// Do your checks to determine if the model may be searched by the user
	return true;
}
```

This feature lets you restrict user searches to only the models they are allowed to see.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~84 days

Total

8

Last Release

2673d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5071665?v=4)[Alex Blake](/maintainers/AlexBlake)[@AlexBlake](https://github.com/AlexBlake)

![](https://avatars.githubusercontent.com/u/26792721?v=4)[AssembleOnline](/maintainers/AssembleOnline)[@AssembleOnline](https://github.com/AssembleOnline)

---

Tags

eloquentlaravellaravel5search

### Embed Badge

![Health badge](/badges/assemble-eloquentsearch/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11222.5M32](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[mozex/laravel-scout-bulk-actions

Import, flush, and queue-import all your Laravel Scout searchable models at once. Auto-discovers models, runs in bulk, tracks progress.

1437.7k](/packages/mozex-laravel-scout-bulk-actions)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

111.6k](/packages/ramadan-easy-model)

PHPackages © 2026

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