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

ActiveModule

netcore/module-search
=====================

Search module.

v0.0.5(8y ago)0180MITPHPPHP &gt;=7.0

Since Nov 30Pushed 8y ago5 watchersCompare

[ Source](https://github.com/netcore/module-search)[ Packagist](https://packagist.org/packages/netcore/module-search)[ Docs](http://netcore.lv)[ RSS](/packages/netcore-module-search/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)DependenciesVersions (7)Used By (0)

Module for easy search implementation
-------------------------------------

[](#module-for-easy-search-implementation)

This module was made for easy searching in database.

Features
--------

[](#features)

- Multiple models per request
- Search through multi-level relations

Pre-installation
----------------

[](#pre-installation)

This module is part of Netcore CMS ecosystem and is only functional in a project that has following packages installed:

1.

### Installation

[](#installation)

1. Require this package using composer

```
    composer require netcore/module-search
```

2. Add SearchableContract and configure searchable models

```
    use Illuminate\Database\Eloquent\Model;
    use Modules\Search\Contracts\SearchableContract;

    class Article extends Model implements SearchableContract {
        ...

        /**
         * Get the config of search module for building queries.
         *
         * @return array
         */
        public function getSearchConfig(): array
        {
            return [
                // Base table colums
                'columns' => [
                    'slug',
                    'author_name',
                    'author_surname',
                ],

                // Add constant wheres if necessary
                // Helpful for columns like is_active, is_published etc..
                'wheres' => [
                    'is_active' => true,
                ],

                // Search in relations
                'relations' => [
                    'translations' => [
                        'columns' => [
                            'title',
                            'content',
                            'intro_text',
                        ],
                        'wheres' => [
                            'locale' => app()->getLocale() // search only in translations for current locale
                        ],
                        // Nested relations supported
                        'relations' => [...]
                    ]
                ]
            ];
        }

        ...
    }
```

### Searching records

[](#searching-records)

- To find something, you must use search() helper method

```
    $page = (int)request('page', 1) ?? 1;

    $results = search()
        ->of(\App\Article::class) // set searchable models (multiple allowed)
        ->setPage($page) // optional - set the current page (1st is by default)
        ->setRecordsPerPage(15) // optional - set records count per page (20 is by default)
        ->withLoggedQueries() // optional - enables query logging
        ->returnAsCollection() // optional - returns collection instead of array
        ->where(\App\Article::class, 'translations.is_active', true) // add additional where to translations relation
        ->where(\App\Article::class, 'is_awesome', true) // add additional where to base model
        ->find('keyword');

    dd($results);
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~2 days

Total

6

Last Release

3076d ago

### Community

Maintainers

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

---

Top Contributors

[![NViktors](https://avatars.githubusercontent.com/u/26169825?v=4)](https://github.com/NViktors "NViktors (11 commits)")[![danielsGrietins](https://avatars.githubusercontent.com/u/24427373?v=4)](https://github.com/danielsGrietins "danielsGrietins (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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