besnik/laravel-filtering

这是一个强大的工具,适用于使用Laravel框架的开发者,他们希望在他们的Web应用程序中实现筛选功能。此包允许您轻松地将筛选器添加到查询中,使用户能够根据各种标准搜索特定数据。

1.1.0 2023-05-23 09:18 UTC

This package is not auto-updated.

Last update: 2024-09-24 15:45:50 UTC


README

php artisan vendor:publish --provider="Besnik\LaravelFiltering\LaravelFilteringServiceProvider" --tag="besnik-filtering-config"

选项字段配置

  1. 一个
 [
    'options' => [],
    'label_key' => 'name',
    'value_key' => 'id',
 ]
  1. 两个
 [
    'model' => User::class,
    'label_key' => 'name',
    'value_key' => 'id',
 ]
  1. 三个
 [
    'model' => User::class,
    'label_key' => 'name',
    'value_key' => 'id',
    'search' => true
 ]
  1. 三个
 [
    'api' => 'url',
    'method' => 'get',
    'label_key' => 'name',
    'value_key' => 'id',
    'search' => true //optional 
 ]