laravel-enso/select 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

laravel-enso/select

Composer 安装命令:

composer require laravel-enso/select

包简介

Server-side option and typeahead builders for Laravel Enso

README 文档

README

License Stable Downloads PHP Issues Merge Requests

Description

Select provides the server-side option and typeahead builders used by Laravel Enso select controls.

The package ships traits for controller-style endpoints and a configurable Options response service that supports selected values, search queries, plain filters, pivot filters, resources, appended attributes, and nested relation attributes.

It can be used inside or outside Enso when a Laravel application needs consistent server-side select data feeds.

Installation

Install the package:

composer require laravel-enso/select

Publish the configuration if you want to change defaults such as trackBy, searchMode, or query attributes:

php artisan vendor:publish --tag=select-config

Features

  • OptionsBuilder trait for standard select endpoints.
  • TypeaheadBuilder trait for typeahead payload conversion.
  • Options service implementing Responsable.
  • Search across local attributes and nested relation attributes.
  • Support for selected values, pagination limit, params, pivot params, custom resources, and model appends.

Usage

Typical options endpoint:

class Options
{
    use OptionsBuilder;

    protected string $model = Company::class;
    protected array $queryAttributes = ['name', 'person.name'];
}

Typical typeahead endpoint:

class Typeahead
{
    use TypeaheadBuilder;

    protected string $model = Company::class;
}

Supported request inputs include:

  • value
  • query
  • paginate
  • trackBy
  • searchMode
  • params
  • pivotParams

API

Builder traits

  • LaravelEnso\\Select\\Traits\\OptionsBuilder
  • LaravelEnso\\Select\\Traits\\TypeaheadBuilder

Response service

  • LaravelEnso\\Select\\Services\\Options

Behavior:

  • merges selected values ahead of fresh results
  • applies direct and pivot relation filters
  • performs filter-based search through laravel-enso/filters
  • sorts by the first query attribute when possible
  • returns a collection or an API resource collection

Depends On

Required Enso packages:

Companion frontend package:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

统计信息

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

GitHub 信息

  • Stars: 26
  • Watchers: 5
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固