ssistemas/searchable

Laravel 5 searchable
22
Install
composer require ssistemas/searchable
Latest Version:1.0.0
PHP:>=5.6.4
License:MIT
Last Updated:Sep 23, 2017
Links: GitHub  ·  Packagist
Maintainer: santty

Searchable for Laravel 5.*

a simple trait to use with your Laravel Models

Usage

Step 1: Install Through Composer

 composer require ssistemas/searchable:"1.*"

Step 2: Install Trait model

just add in your models

    class User extends Model
    {
        use Ssistemas\Searchable\Traits\Searchable;
        private $searchable = [
            'columns'=>['category.name'],
            'joins'=>[
                'customers' => ['category.id','user.category_id'],
            ],
        'orders'=>['category.name,asc'],
        ];
        ...
    }

Step 2: Use Controller

you can also use controller

    $users = User::search($value)->get();