PHPackages                             shortcodes/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. shortcodes/search

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

shortcodes/search
=================

Useful traits for different methods to search data (elasticsearch ,eloquent)

1.0.8(6y ago)12.6kmitPHPPHP &gt;=7.0.0

Since Feb 7Pushed 6y agoCompare

[ Source](https://github.com/shortcodes/search)[ Packagist](https://packagist.org/packages/shortcodes/search)[ RSS](/packages/shortcodes-search/feed)WikiDiscussions master Synced 2mo ago

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

DEPRECATED
==========

[](#deprecated)

search
======

[](#search)

Useful traits for different methods to search data (elasticsearch ,eloquent)

configuring elasticsearch
=========================

[](#configuring-elasticsearch)

In **config/services.php** you need to add

```
'search' => [
    'enabled' => env('ELASTICSEARCH_ENABLED', false),
    'hosts' => explode(',', env('ELASTICSEARCH_HOSTS')),
],

```

And add variables to **.env**

```
ELASTICSEARCH_ENABLED=true
ELASTICSEARCH_HOSTS=localhost:9200
ELASTICSEARCH_PREFIX=prefix #if you use more than 1 application on same elastic server

```

Every elastic model need to use **Elasticable** trait

To search in elasticsearch there is a need to use method searchParameters in model

```
public function searchParameters($request) : array
{
    //must return array with elasticsearch rules

    return [];
}

```

configuring eloquent search
===========================

[](#configuring-eloquent-search)

Every eloquent type search model need to use **Searchable** trait and implement searchParameters method

```
public function searchParameters($query,$request)
{
    //must return queryBuilder class

    return $query;
}

```

manually reindex classes that uses trait
========================================

[](#manually-reindex-classes-that-uses-trait)

Every eloquent type search model need to use **Searchable** trait and implement searchParameters method

```
php artisan search:reindex

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community6

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

Recently: every ~68 days

Total

9

Last Release

2363d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30219536?v=4)[Roman Szymański](/maintainers/shortcodes)[@shortcodes](https://github.com/shortcodes)

---

Top Contributors

[![shortcodes](https://avatars.githubusercontent.com/u/30219536?v=4)](https://github.com/shortcodes "shortcodes (11 commits)")

### Embed Badge

![Health badge](/badges/shortcodes-search/health.svg)

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

###  Alternatives

[ruflin/elastica

Elasticsearch Client

2.3k50.4M202](/packages/ruflin-elastica)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[ongr/elasticsearch-dsl

Elasticsearch DSL library

46411.9M46](/packages/ongr-elasticsearch-dsl)[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)[ongr/elasticsearch-bundle

Elasticsearch bundle for Symfony.

3151.1M15](/packages/ongr-elasticsearch-bundle)

PHPackages © 2026

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