承接 dsoloview/laravel-filters-sort 相关项目开发

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

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

dsoloview/laravel-filters-sort

最新稳定版本:1.3.2

Composer 安装命令:

composer require dsoloview/laravel-filters-sort

包简介

Laravel filters and sort

README 文档

README

A small package that will allow you to easily and configurably filter and sort your query

Features

  • Customize sorting and filtering for each parameter
  • Easy to set default options
  • Structures the code
  • Easily expandable

Installation

Install dsoloview/laravel-filters-sort from composer

  composer require dsoloview/laravel-filters-sort

Usage

Model

For the model, you need to add traits HasFilters and HasSort Model

Filter

Create filter class for your model and extends it from dsoloview\LaravelFiltersSort\Filters\QueryFilter

Сreate a method for each parameter you will receive from the filter request

For example:

applicaitons?filters[categories][]=7&filters[search]=myApp

Filter

Sort

Create sort class for your model and extends it from dsoloview\LaravelFiltersSort\Sort\QuerySort

Сreate a method for each parameter you will receive from the sort request

For example:

applicaitons?sort=id&direction=asc

Sort

You can set default param for sort

protected const SORT_DEFAULT = 'param'

And for direction

protected const DIRECTION_DEFAULT = 'asc|desc'

Usage

Traits add scopes filter(QueryFilter) and sort(QuerySort) to your model

Usage

You can pass your filter and sort classes to scopes like in the screenshot.

After it you can make get() or paginate() like in example.

Support

For support, telegram @dsoloview.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固