tranquil-tools/laravel-vue-table-builder 问题修复 & 功能扩展

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

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

tranquil-tools/laravel-vue-table-builder

Composer 安装命令:

composer require tranquil-tools/laravel-vue-table-builder

包简介

A VueJS/Inertia TableBuilder package for Laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A powerful and flexible table builder package for Laravel with Vue 3, Inertia.js, and shadcn-vue components.

CrudBuilder

Want a complete CRUD solution? Our CrudBuilder builds on top of this TableBuilder and the FormBuilder to give you full create, read, update, and delete flows without repetitive boilerplate.

Installing the CrudBuilder pulls in this package automatically as a Composer dependency.

Installation

You can install the package via composer:

composer require tranquil-tools/laravel-vue-table-builder

Install the required npm packages:

npm install reka-ui lucide-vue-next

Alter your vite.config.ts to add an @table-builder alias:

import {defineConfig} from 'vite';
import path from 'path';

export default defineConfig({
    plugins: [
        // ...
    ],
    resolve: {
        alias: {

            // Add this:

            '@table-builder': path.resolve(__dirname, 'vendor/tranquil-tools/laravel-vue-table-builder/resources/js'),
        },
    },
});

You can publish the config file with:

php artisan vendor:publish --tag="vue-table-builder-config"

The content of the published config can be viewed here.

Usage

Backend (Laravel)

Create a table class:

use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use TranquilTools\TableBuilder\AbstractTable;
use TranquilTools\TableBuilder\TableBuilder;

class UsersTable extends AbstractTable
{
    public function for(): Builder
    {
        return User::query();
    }

    public function configure(TableBuilder $table)
    {
        $table
            ->defaultSort('name')
            ->withGlobalSearch(columns: ['name', 'email'])
            ->column('id', 'ID')
            ->column('name', 'Name', sortable: true)
            ->column('email', 'Email', sortable: true)
            ->column('created_at', 'Created', sortable: true)
            ->paginate(25);
    }
}

In your controller:

use Inertia\Inertia;

public function index()
{
    return Inertia::render('Users/Index', [
        'table' => \App\Tables\UsersTable::build(),
    ]);
}

Frontend (Vue)

Import the TableBuilder component:

<script setup lang="ts">
    import {TableBuilder} from '@/components'
    import type {TableData} from '@/types/table-builder'

    defineProps<{
        table: TableData
    }>()
</script>

<template>
    <div>
        <h1>Users</h1>
        <TableBuilder :table="table"/>
    </div>
</template>

Features

  • 🎨 Beautiful UI with shadcn-vue table components
  • 🔍 Sortable columns with visual indicators
  • 📄 Pagination with Inertia.js optimization
  • 🎯 Nested relationship support (e.g., user.company.name)
  • 🚀 Built with TypeScript for type safety
  • ⚡ Optimized navigation with preserve-state and preserve-scroll
  • 📱 Fully responsive design

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固