underwear/laravel-vue-good-table

Vue-good-table wrapper for Laravel. Server side tables without pain.
16,732 40
Install
composer require underwear/laravel-vue-good-table
Latest Version:v1.5
PHP:^7.1|^8.0
Laravel:5 – 9
License:MIT
Last Updated:Nov 27, 2023
Links: GitHub  ·  Packagist
Maintainer: underwear

laravel-vue-good-table

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.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released PHP Laravel License
v1.5 ^7.1|^8.0 ^5.6|^6.0|^7.0|^8.0|^9.0 MIT
v1.4 ^7.1|^8.0 ^5.6|^6.0|^7.0|^8.0 MIT
v1.3 ^7.1 ^5.6 MIT
v1.2 ^7.1 ^5.6 MIT
v1.1 ^7.1 ^5.6 MIT
Pre-releases (1)
Version Released PHP Laravel License
v0.1-alpha ^7.1 ^5.6 MIT