lifeonscreen/nova-sort-relations 问题修复 & 功能扩展

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

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

lifeonscreen/nova-sort-relations

最新稳定版本:v0.0.2

Composer 安装命令:

composer require lifeonscreen/nova-sort-relations

包简介

This package improves support for sorting relations in Laravel Nova.

README 文档

README

This package improves support for sorting relations in Laravel Nova.

Installation

Install via composer

$ composer require lifeonscreen/nova-sort-relations

Usage

Include LifeOnScreen\SortRelations\SortRelations trait to your class. Define base by overriding indexQuery. Define sortable columns in $sortRelations array.

... use LifeOnScreen\SortRelations\SortRelations; ... class Product extends Resource { public static $sortRelations = [ // overriding id with product.id (this prevent ambiguous id, if you select multiple ids) 'id' => 'product.id', // overriding user relation sorting 'user' => [ // sorting multiple columns 'users.name', 'users.surname', ], // overriding company relation sorting 'company' => 'company.name', ]; public static function indexQuery(NovaRequest $request, $query) { // You can modify your base query here. return $query; } }

Security

If you discover any security-related issues, please email the author instead of using the issue tracker.

Credits

License

MIT license. Please see the license file for more information.

统计信息

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

GitHub 信息

  • Stars: 20
  • Watchers: 2
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固