PHPackages                             constantable/laravel-scout-sphinx - 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. constantable/laravel-scout-sphinx

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

constantable/laravel-scout-sphinx
=================================

Laravel Scout Sphinx Driver

3.0(2y ago)2054.7k—8.3%25[4 issues](https://github.com/constantable/laravel-scout-sphinx/issues)1MITPHPPHP &gt;=7.0CI failing

Since Jun 20Pushed 2y ago2 watchersCompare

[ Source](https://github.com/constantable/laravel-scout-sphinx)[ Packagist](https://packagist.org/packages/constantable/laravel-scout-sphinx)[ RSS](/packages/constantable-laravel-scout-sphinx/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (16)Used By (1)

Laravel Scout Sphinx Driver
===========================

[](#laravel-scout-sphinx-driver)

Introduction
------------

[](#introduction)

This package is fork of constantable/laravel-scout-sphinx. package offers advanced functionality for searching and filtering data using the [Sphinx full text search server](http://sphinxsearch.com/) for [Laravel Scout](https://laravel.com/docs/master/scout).

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

[](#installation)

### Composer

[](#composer)

Use the following command to install this package via Composer.

```
composer require constantable/laravel-scout-sphinx
```

### Configuration

[](#configuration)

Publish the Scout configuration using the `vendor:publish` Artisan command.

```
php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
```

This command will publish the `scout.php` configuration file to your config directory, which you can than edit and set `sphinxsearch` as the Scout driver.

```
'driver' => env('SCOUT_DRIVER', 'sphinxsearch'),
```

To configure the connection to Sphinx server add the following (i.e. default) connection options.

```
    'sphinxsearch' => [
        'host' => env('SPHINX_HOST', 'localhost'),
        'port' => env('SPHINX_PORT', '9306'),
        'socket' => env('SPHINX_SOCKET'),
        'charset' => env('SPHINX_CHARSET'),
    ],
```

Override these variables in your `.env` file if required.

Usage
-----

[](#usage)

- Add the `Laravel\Scout\Searchable` trait to the model you would like to make searchable.
- Customize the index name and searchable data for the model:

```
    public function searchableAs()
    {
        return 'posts_index';
    }

    public function toSearchableArray()
    {
        $array = $this->toArray();

        // Customize array...

        return $array;
    }
```

A basic search:

```
$orders = App\Order::search('Star Trek')->get();
```

Please refer to the [Scout documentation](https://laravel.com/docs/master/scout#searching) for additional information. You can run more complex queries on the index by using a callback, setting the `where` clause, `orderBy`, or `paginate` threshold. For example:

```
$orders = App\Order::search($keyword, function (SphinxQL $query) {
        return $query->groupBy('description');
    })
    ->where('status', 1)
    ->orderBy('date', 'DESC')
    ->paginate(20);
```

Note: Changes on Sphinx indexes are only allowed for RT (Real-time) indexes. If you have these and need to update/delete records please define `public $isRT = true;` in the model's property.

Credits
-------

[](#credits)

- [Hyn](https://github.com/hyn)

License
-------

[](#license)

Licensed under the MIT license

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 62.5% 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 ~119 days

Recently: every ~334 days

Total

14

Last Release

980d ago

Major Versions

1.x-dev → 2.02019-09-10

2.7 → 3.02023-09-11

PHP version history (2 changes)1.0PHP &gt;=5.6.4

1.x-devPHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/db11bba565a0030ca281e3804f1e589c5443d41fa9881f3eb0c65451849d2a96?d=identicon)[constantable](/maintainers/constantable)

---

Top Contributors

[![constantable](https://avatars.githubusercontent.com/u/11844178?v=4)](https://github.com/constantable "constantable (20 commits)")[![Jon78](https://avatars.githubusercontent.com/u/51792370?v=4)](https://github.com/Jon78 "Jon78 (4 commits)")[![MaxKorlaar](https://avatars.githubusercontent.com/u/8917249?v=4)](https://github.com/MaxKorlaar "MaxKorlaar (2 commits)")[![ben221199](https://avatars.githubusercontent.com/u/12856904?v=4)](https://github.com/ben221199 "ben221199 (2 commits)")[![raphaelstolt](https://avatars.githubusercontent.com/u/48225?v=4)](https://github.com/raphaelstolt "raphaelstolt (1 commits)")[![eljump](https://avatars.githubusercontent.com/u/45133615?v=4)](https://github.com/eljump "eljump (1 commits)")[![notcgi](https://avatars.githubusercontent.com/u/56194947?v=4)](https://github.com/notcgi "notcgi (1 commits)")[![0xSheff](https://avatars.githubusercontent.com/u/12431039?v=4)](https://github.com/0xSheff "0xSheff (1 commits)")

---

Tags

laravelscoutsphinxsphinxsearch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/constantable-laravel-scout-sphinx/health.svg)

```
[![Health](https://phpackages.com/badges/constantable-laravel-scout-sphinx/health.svg)](https://phpackages.com/packages/constantable-laravel-scout-sphinx)
```

###  Alternatives

[teamtnt/laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch

1.1k2.5M28](/packages/teamtnt-laravel-scout-tntsearch-driver)[algolia/scout-extended

Scout Extended extends Laravel Scout adding algolia-specific features

4186.3M6](/packages/algolia-scout-extended)[matchish/laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout

7431.6M2](/packages/matchish-laravel-scout-elasticsearch)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)[typesense/laravel-scout-typesense-driver

Laravel Scout Driver for Typesense

144637.2k3](/packages/typesense-laravel-scout-typesense-driver)[zing/laravel-scout-opensearch

Laravel Scout custom engine for OpenSearch

33340.2k](/packages/zing-laravel-scout-opensearch)

PHPackages © 2026

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