承接 xingchuangyang/dcat-admin-sortable 相关项目开发

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

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

xingchuangyang/dcat-admin-sortable

最新稳定版本:v1.0.0

Composer 安装命令:

composer require xingchuangyang/dcat-admin-sortable

包简介

dcat-admin 表格排序插件

README 文档

README

截图

使用

引入 composer 包

composer require xingchuangyang/dcat-admin-sortable

修改 Model

引入 SortableTrait,并实现 Sortable 接口

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Spatie\EloquentSortable\Sortable;
use Spatie\EloquentSortable\SortableTrait;

class Product extends Model implements Sortable
{
    use SortableTrait;

    public $sortable = [
        'order_column_name' => 'sort',  // 排序字段
        'sort_when_creating' => true,   // 新增是否自增,默认自增
    ];
}

在 Controller 中使用

$grid->column('sort', '排序')->action(\Xcy\DcatAdminSortable\Actions\SortableColumnRow::gen(\App\Models\Product::class));

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-07