artwinpro / laravel-search
Simple search for laravel 5.
1.1
2016-11-09 10:56 UTC
Requires
- php: >=5.5.9
- laravel/framework: 5.1.*|5.2.*|5.3.*
This package is not auto-updated.
Last update: 2024-11-09 20:28:27 UTC
README
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=example@email.com&phone=+37063028205