laravel-filter maintained by mohammadabusultan
Description
A Laravel package for adding filter functionality to models.
Author
Last update
2023/07/04 16:55
(dev-master)
License
Downloads
3
Laravel Filter
A laravel package to filter via your models .
installation :
composer require mohammadabusultan/laravel-filter
Usage :
- use
Filterabletrait in your model - Define
$filtersarray property in your model to select which columns to filter in
Example :
use Mohammadabusultan\LaravelFilter\Filterable;
class User extends Model {
use Filterable ;
protected $filters = ['name' => 'like', 'status' => '=', 'posts.title' => 'like'];
public function posts(){
return $this->hasMany(Post::class);
}