PHPackages                             divineomega/laravel-omega-search - 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. divineomega/laravel-omega-search

Abandoned → [jord-jd/laravel-omega-search](/?search=jord-jd%2Flaravel-omega-search)Library[Search &amp; Filtering](/categories/search)

divineomega/laravel-omega-search
================================

Easily add an intelligent search engine to your Laravel powered website or web application

v4.0.0(2mo ago)102352LGPL-3.0-onlyPHPPHP &gt;=7.1CI failing

Since Jul 23Pushed 2mo agoCompare

[ Source](https://github.com/Jord-JD/laravel-omega-search)[ Packagist](https://packagist.org/packages/divineomega/laravel-omega-search)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-laravel-omega-search/feed)WikiDiscussions master Synced yesterday

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

Laravel Omega Search
====================

[](#laravel-omega-search)

Omega Search allows you to easily add an intelligent search engine to your Laravel powered website or web application. It can be configured to search any of your Eloquent models.

Under the hood, this uses the [Omega Search](https://github.com/Jord-JD/omega-search) package.

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

[](#installation)

You can install this package with Composer.

```
composer require jord-jd/laravel-omega-search

```

Usage
-----

[](#usage)

To use Laravel Omega Search, first add the `OmegaSearchTrait`to the models you wish to search. You must then implement the following two abstract methods.

- `getOmegaSearchFieldsToSearch()` - Must return an array of the model's fields to search.
- `getOmegaSearchConditions()` - Must return an associative array of the search conditions. Example: `['active' => 1, 'discontinued' => 0]`

After this setup, a search can be performed by calling the static `omegaSearch($searchText)` method on the model. This method performs an intelligent fuzzy search, and returns a query builder filtered to the related records in descending order of relevance.

The related models can then be retrieved (`->get()`) or paginated (`->paginate()`) as required.

Joining Tables
--------------

[](#joining-tables)

If you want to search the content of related tables, you can use joins. Simply override the `getOmegaSearchTablesToJoin` on your model and return an array of `OmegaSearchJoins`.

#### Defining Joins

[](#defining-joins)

##### Join by related keys

[](#join-by-related-keys)

There are two ways to define joins. The first way is to call the `OmegaSearchJoin::joinTableByForeignKey` method. You have to pass the local table name and joined table name to this method.

By default the key on the joined table will be the joined table name singularised with `_id` appended and the key on the local table will `id`. These can be set manually using the 3rd and 4th parameter for this method.

See below for an example:

```
    public function getOmegaSearchTablesToJoin()
    {
        return [
            OmegaSearchJoin::joinTableByForeignKey($this->getTable(), 'divisions'),
        ];
    }
```

or

```
    public function getOmegaSearchTablesToJoin()
    {
        return [
            OmegaSearchJoin::joinTableByForeignKey($this->getTable(), 'divisions', 'id', 'division_id),
        ];
    }
```

You can chain joins as seen below:

```
    public function getOmegaSearchTablesToJoin()
    {
        return [
            OmegaSearchJoin::joinTableByForeignKey($this->getTable(), 'divisions'),
            OmegaSearchJoin::joinTableByForeignKey('divisions', 'companies', 'id', 'company_id')
        ];
    }
```

##### Join Manually

[](#join-manually)

If you want to join tables that are not just linked by related keys you can manually add conditions to a join. To do this create a new `OmegaSearchJoin` object and call the `addCondition` method to add your conditions. You must specify the local table name and the joined table name in the constructor. Optionally you can specify the join type, the default is `JOIN`

When adding a condition the parameter on the left will automatically have the local table name prepended and the joined table name will be prepended to the right condition.

See below for an example:

```
    public function getOmegaSearchTablesToJoin()
    {
        $join = new OmegaSearchJoin('contacts', 'divisions', 'INNER JOIN');
        $join->addCondition('gross_income', '>', 'annual_income');

        return [
            $join,
        ];
    }
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance83

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~300 days

Recently: every ~546 days

Total

9

Last Release

87d ago

Major Versions

v1.1.0 → v2.0.02019-11-16

v2.1.0 → v3.0.02026-02-14

v3.0.0 → v4.0.02026-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (15 commits)")[![NilesB](https://avatars.githubusercontent.com/u/7305403?v=4)](https://github.com/NilesB "NilesB (3 commits)")

---

Tags

fuzzy-searchlaravellaravel-5-packagephpphp-librarysearchsearch-engine

### Embed Badge

![Health badge](/badges/divineomega-laravel-omega-search/health.svg)

```
[![Health](https://phpackages.com/badges/divineomega-laravel-omega-search/health.svg)](https://phpackages.com/packages/divineomega-laravel-omega-search)
```

###  Alternatives

[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)
