PHPackages                             skyraptor/modelsearch - 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. skyraptor/modelsearch

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

skyraptor/modelsearch
=====================

0.4.1(6y ago)5229[2 issues](https://github.com/bumbummen99/laravel-modelsearch/issues)[3 PRs](https://github.com/bumbummen99/laravel-modelsearch/pulls)MITPHPCI failing

Since Nov 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/bumbummen99/laravel-modelsearch)[ Packagist](https://packagist.org/packages/skyraptor/modelsearch)[ RSS](/packages/skyraptor-modelsearch/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (6)Dependencies (5)Versions (13)Used By (0)

Laravel ModelSearch
===================

[](#laravel-modelsearch)

[![CI](https://github.com/bumbummen99/laravel-modelsearch/workflows/CI/badge.svg)](https://github.com/bumbummen99/laravel-modelsearch/workflows/CI/badge.svg)[![codecov](https://camo.githubusercontent.com/fe8e947f035a9452419f38f923c909f3913f4f09081ac51ebd9b16b3a240a35f/68747470733a2f2f636f6465636f762e696f2f67682f62756d62756d6d656e39392f6c61726176656c2d6d6f64656c7365617263682f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/bumbummen99/laravel-modelsearch)[![StyleCI](https://camo.githubusercontent.com/da326e88469d4e066dbefecccca1c98d7b46aa096a6ba213da0dd9e3bd4f5470/68747470733a2f2f7374796c6563692e696f2f7265706f732f3135393636363534372f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/159666547)[![Total Downloads](https://camo.githubusercontent.com/3ba30b01e7eb616eab2ac04141fc844791137c84c7571e7d15dd3ac7dd253cee/68747470733a2f2f706f7365722e707567782e6f72672f736b79726170746f722f6d6f64656c7365617263682f646f776e6c6f6164732e706e67)](https://packagist.org/packages/skyraptor/modelsearch)[![Latest Stable Version](https://camo.githubusercontent.com/8ac26fcf9b8be86bc2396eb7a590b5956662251a03baa0f2eaf23ad974944c20/68747470733a2f2f706f7365722e707567782e6f72672f736b79726170746f722f6d6f64656c7365617263682f762f737461626c65)](https://packagist.org/packages/skyraptor/modelsearch)[![Latest Unstable Version](https://camo.githubusercontent.com/5a9a25dbb3f1af8eb75fa23322bf9f5b2d5e430fafebd43a67b55ec1498d46b7/68747470733a2f2f706f7365722e707567782e6f72672f736b79726170746f722f6d6f64656c7365617263682f762f756e737461626c65)](https://packagist.org/packages/skyraptor/modelsearch)[![License](https://camo.githubusercontent.com/50a0ea0250d7b6797d80837e971b8f99a9bc91ad2c92a741445096e37a8cf869/68747470733a2f2f706f7365722e707567782e6f72672f736b79726170746f722f6d6f64656c7365617263682f6c6963656e7365)](https://packagist.org/packages/skyraptor/modelsearch)[![Homepage](https://camo.githubusercontent.com/22e0a6e01a7758c0a3da17bd630c10ef7a7bb51fa1cf27c13cae41124bef190a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f686f6d65706167652d736b79726170746f722e65752d696e666f726d6174696f6e616c2e7376673f7374796c653d666c6174266c6f676f3d6170707665796f72)](https://skyraptor.eu)

Laravel ModelSearch is a lightweight, easy to use package to create dynamic search queries for specific Models with Laravel or Illuminate 5.8.

Requirements
============

[](#requirements)

- Laravel 5.7+

Installation
============

[](#installation)

Composer
--------

[](#composer)

Simply run `composer require skyraptor/modelsearch` to install the package in its latest version, after that run `composer update`. The package will register its own ServiceProvider using Laravels package discovery.

Configuration
-------------

[](#configuration)

This package includes its own configuration file which you should publish by with the command `php artisan vendor:publish` and following the instuctions on screenafterwards. In the configuration file you have to adjust the namespace for you filters directory and your request filter prefix.

```
return [
   'filtersFQCN' => 'App\\Filters\\',
   'requestFilterPrefix' => 'filter_'
];
```

Filters
-------

[](#filters)

In order to define a filter you have to create a folder that is named as your model within your filters directory. Within this folder you can create filter specific to the model. For example:
`path\to\laravel\app\Filters\User\HasId.php`Your filter has to extend ModelSearch\\Contracts\\Filter.

```
