Skip to content

ARTWINPRO/laravel-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Search

Made for Laravel 5 Latest Tag

Installation

You can install this package by simply run this composer command:

composer require artwinpro/laravel-search

Or require the package in your composer.json:

"artwinpro/laravel-search": "dev-master"

and run

composer update

Usage

Add in model App\Posts:

use Artwinpro\LaravelSearch\SearchTrait;
 
class Posts extends Model
{
    use SearchTrait;
    
    // Searchable fields.
    public $searchable =  ['name', 'email', 'phone'];
}

And use:

 $posts = Posts::search()->get(); // Get searched posts from the database.

Request:

 /?name=Admin&[email protected]&phone=+37063028205

About

A simple App\Model::search() for laravel 5.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages