定制 indexzer0/eloquent-filtering 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

indexzer0/eloquent-filtering

最新稳定版本:2.2.0

Composer 安装命令:

composer require indexzer0/eloquent-filtering

包简介

Powerful eloquent filtering

README 文档

README

Filter example

Latest Version on Packagist Total Downloads GitHub Tests Action Status Codecov

Easily filter eloquent models using arrays

Eloquent Filtering simplifies implementing search functionality for your Eloquent models, whether simple or complex, by eliminating the need for custom query logic. It allows you to easily define and manage filters directly within your models, and seamlessly apply them using incoming HTTP request data to dynamically filter your models.

With this package, you can build more readable, maintainable, and scalable code, boosting your productivity and speeding up development.

Whether you’re building APIs, dashboards, or advanced search systems, Eloquent Filtering provides a powerful and flexible way to streamline your Eloquent queries, making it easier to manage and extend your application’s filtering capabilities.

View The Docs

Quick Look

class Product extends Model implements IsFilterable
{
    use Filterable;

    public function allowedFilters(): AllowedFilterList
    {
        return Filter::only(
            Filter::field('name', [FilterType::EQUAL]),
        );
    }
}

$products = Product::filter([
    [
        'target' => 'name',
        'type'   => '$eq',
        'value'  => 'TV'
    ]
])->get();

Requirements

  • PHP Version >= 8.2
  • Laravel Version >= 10

Installation

You can install the package via composer:

composer require indexzer0/eloquent-filtering

Run the install artisan command to publish the config:

php artisan eloquent-filtering:install

Testing

composer test

Docs

npm i -g mintlify
cd docs
mintlify dev

Changelog

Please see CHANGELOG for more information on what has changed recently.

Feature Ideas

Please see Feature ideas for potential future features.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 18.86k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 226
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 226
  • Watchers: 3
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固