承接 nico-sorice/laravel-query-filterer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

nico-sorice/laravel-query-filterer

Composer 安装命令:

composer require nico-sorice/laravel-query-filterer

包简介

A laravel package for filtering queries with http request

README 文档

README

This package allows you to set conditional rules to filter a query according to the HTTP request values with ease and speed.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

This package requires php7.0 or up, laravel 5.5 or up and composer installed on your computer.

composer
php >= 7.0.0
laravel >= 5.5

Installation

Require using composer

composer require nico-sorice/laravel-query-filterer

Usage

In your controller

<?php

use NicoSorice\QueryFilterer\PackageClasses\QueryFilterer;

New QueryFilterer(
    Model::query(),
    request()
 )->filter([
     'id'        => WhereFilter::class,
     'status_id' => WhereInFilter::class,
     'date'      => (new WhereDateBetweenFiter)->setFormat('d/m/Y'),
 ])

Full list of available filters

The package includes validation rules for the filters that require them

In your request

<?php

 /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id'   => 'nullable|integer',
            'date' => [
                'nullable', 
                new FilterWhereDateBetweenValidationRule
            ]
        ];
    }

Full list of available validation rules

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of CONTRIBUTORS.md who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固