PHPackages                             arslanayoub/searchable-scope - 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. arslanayoub/searchable-scope

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

arslanayoub/searchable-scope
============================

Reusable search scope trait for Laravel models with nested relation and priority support.

0214PHPCI failing

Since Aug 27Pushed 8mo agoCompare

[ Source](https://github.com/arslanayoub48/laravel-search)[ Packagist](https://packagist.org/packages/arslanayoub/searchable-scope)[ RSS](/packages/arslanayoub-searchable-scope/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SearchableScope Package
=======================

[](#searchablescope-package)

A reusable search scope trait for Laravel models with nested relation and priority support.

📦 Package Information
---------------------

[](#-package-information)

- **Package Name:** `arslanayoub/searchable-scope`
- **Description:** Reusable search scope trait for Laravel models with nested relation and priority support
- **License:** MIT
- **Author:** Arslan Ayoub

🚀 Installation
--------------

[](#-installation)

### 1. Local Package Setup

[](#1-local-package-setup)

If you're using this as a local package in your Laravel project:

#### Step 1: Add Repository to Main composer.json

[](#step-1-add-repository-to-main-composerjson)

Add the following to your main project's `composer.json`:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "packages/ArslanAyoub/SearchableScope"
    }
  ],
  "require": {
    "arslanayoub/searchable-scope": "dev-main"
  }
}
```

#### Step 2: Install Package

[](#step-2-install-package)

```
composer update arslanayoub/searchable-scope
```

#### Step 3: Publish Configuration

[](#step-3-publish-configuration)

```
php artisan vendor:publish --tag=config
```

This will create a `config/searchable-scope.php` file in your Laravel project.

### 2. Package Structure

[](#2-package-structure)

```
packages/ArslanAyoub/SearchableScope/
├── composer.json
├── README.md
├── config/
│   └── searchable-scope.php
└── src/
    ├── SearchableScopeServiceProvider.php
    └── Traits/
        └── Searchable.php

```

⚙️ Configuration
----------------

[](#️-configuration)

The package comes with a configuration file at `config/searchable-scope.php`:

```
