underwear/laravel-vue-good-table 问题修复 & 功能扩展

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

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

underwear/laravel-vue-good-table

最新稳定版本:v1.5

Composer 安装命令:

composer require underwear/laravel-vue-good-table

包简介

Vue-good-table wrapper for Laravel. Server side tables without pain.

README 文档

README

Customizable table tool for Laravel, uses powerful vue-good-table. Server side tables without pain.

Supports pagination, filtering, searching, sorting. Inspired by Laravel Nova :)

til

Reqs

  • Laravel 5.6+ or Laravel 6, Laravel 7, Laravel 8, Laravel 9
  • Using Vue.js in your project

Usage example

  1. Use InteractsWithVueGoodTable trait in your controller and implement two methods: getColumns() and getQuery().
  2. Register two new routes.
  3. Use Vue component laravel-vue-good-table wherever you want.

Controller:

namespace App\Http\Controllers;

use LaravelVueGoodTable\InteractsWithVueGoodTable;
use LaravelVueGoodTable\Columns\Column;
use LaravelVueGoodTable\Columns\Date;
use Illuminate\Http\Request;
use App\User;

class TestController extends Controller
{
    use InteractsWithVueGoodTable;

    /**
     * Get the query builder
     * 
     * @param Request $request
     *
     * @return Illuminate\Database\Eloquent\Builder
     */
    protected function getQuery(Request $request)
    {
        return User::query();
    }

    /**
     * Get the columns displayed in the table
     *
     * @return array
     */
    protected function getColumns(): array
    {
        return [
            Text::make('ID', 'id')
                ->sortable()
                ->searchable(),
                
            Text::make('Name', 'name')
                ->searchable(),
                
            Text::make('E-mail', 'email')
                ->searchable(),
                
            Date::make('Created At', 'created_at')
                ->sortable()
                ->dateOutputFormat('dd.MM.yyyy HH:mm:ss'),
        ];
    }
}

Routes:

Route::get('/lvgt/config', 'TestController@handleConfigRequest');
Route::get('/lvgt/data', 'TestController@handleDataRequest');

Blade/HTML:

<div id="vue">
    <laravel-vue-good-table data-url="/lvgt/data" config-url="/lvgt/config"/>
</div>

Installation

composer require underwear/laravel-vue-good-table

See the full Installation Guide in DOCUMENTATION.md

Documentation

See DOCUMENTATION.md

Contributing

Contributions are welcome!

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 40
  • Watchers: 1
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-25