ubitcorp/laravel-filter

It provides a Eloquent query builder that can be used with trait on any model for Laravel project

v1.8 2020-01-09 15:48 UTC

This package is not auto-updated.

Last update: 2024-10-25 14:09:27 UTC


README

Latest Stable Version Total Downloads License Monthly Downloads Daily Downloads

Laravel Filter

It provides a Eloquent Filter from request or an array. It can be used with trait on any model for Laravel project

Installation

Via Composer

composer require ubitcorp/laravel-filter

To change configuration file:

php artisan vendor:publish --provider="ubitcorp\Filter\ServiceProvider" 

Usage

This package provides the filter trait that can be included any model. After that the functions below can be used:

//In Project Model (example)
namespace App\Models;

use Illuminate\Database\Eloquent\Model; 
use ubitcorp\Filter\Traits\Filter; 

class Project extends Model
{
  use Filter;
  ...
}
//In a Controller
Project::with("customer")->filter()->paginate();