Simple way to search defined fields in your Storage
Switch branches/tags
Clone or download
Latest commit a00f6b2 Dec 22, 2015
Failed to load latest commit information.
src Migration to Laravel 5 Feb 10, 2015
.gitignore Initial commit Nov 26, 2014
.travis.yml Initial commit Nov 26, 2014
LICENSE Added config path to readme Nov 26, 2014
composer.json Updated dependency Feb 10, 2015 Update Dec 22, 2015

Search Package for Laravel 5

Install With Composer

"require": {
    "remoblaser/search": "^0.3.0"

Configure the app

Add the service provider to config/app.php.

'providers' => array(

Register the alias in the app/config/app.php file.

'aliases' => array(
    'Search' => 'Remoblaser\Search\Facades\Search'

Publish the configuration

php artisan vendor:publish


After publishing the config, you will find a config file under app/packages/remoblaser/search/config.php, bind your Models to a key here, if you have a Posts table for example, add it here:

return array(
    'users' => 'User',
    'posts' => 'My\Sample\Namespace\Post'

Afterwards you have to implement the SearchableTrait in your Model and define the Fields which you would like to search. In this example i would like to search through the titles and the bodies.

<?php namespace My\Sample\Namespace;

use Remoblaser\Search\SearchableTrait;

class Post extends \Eloquent{
    use SearchableTrait;

    protected $searchFields = ['title', 'body'];

Now you can Search through your Tables from anywhere in your application by using the Search Facade, followed by the binding key.


Or you could search all registered Tables for the Keyword.


Feel free to make pull requests, this is my first laravel package so im sure i did things badly