New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

lykegenes/laravel-table-view

An API-based table view for Laravel. Based on Vue.js and Element-UI.
1,562 2

Larablocks Analysis

lykegenes/laravel-table-view works with Laravel 5 to 9 (latest release v1.2.0, Apr 4, 2022), all past end of life (the last on Feb 6, 2024): no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5 to 9, past end of life since Feb 6, 2024
  • No release in the last 12 months (last: Apr 4, 2022)
  • 4 downloads a month (needs 10,000)
  • 2 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Apr 4, 2022.
  • No releases in the last 12 months.
  • First released: Feb 5, 2017.
  • Monthly downloads: 4.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.

Install
composer require lykegenes/laravel-table-view
Latest Version:v1.2.0
Laravel:5 – 9
License:MIT
Last Updated:Dec 12, 2022
Links: GitHub  ·  Packagist
Maintainer: Lykegenes

Laravel Table View

Latest Version on Packagist Software License Build Status Code Coverage Total Downloads

Installation

Composer

Execute the following command to get the latest version of the package:

composer require lykegenes/laravel-table-view

Laravel

In your config/app.php add Lykegenes\TableView\Providers\TableViewServiceProvider::class, to the end of the providers array:

'providers' => [
    ...
    Lykegenes\TableView\Providers\TableViewServiceProvider::class,
],

Usage

Create a Table View

Create a Table View class; it will allow you to configure your table.

<?php

namespace App\TableViews;

use Lykegenes\TableView\AbstractTableView;

class DemoTableView extends AbstractTableView
{
    public function getApiUrl()
    {
        return '/demo-api';
    }

    public function build()
    {
        $this->addColumn('Nom', 'name', [
                'sortable',
            ])
            ->addColumn('Adresse', 'address', [
                'sortable',
            ])
            ->addColumn('Date', 'date', [
                'sortable',
            ])
            ->addTemplateColumn('Tag', 'columns.locationTags')
            ->addTemplateColumn('Operation', 'columns.operations');

        $this->setDefaultSort('date');
    }
}

Displaying the table in a view

Calling the render() method on a TableView instance will compile it and render it. You should call this method inside one of your app's Blade views with the {!! !!} blade statement, in order not to escape the Html. Here is an example of a complete Blade template

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Demo</title>

        <!-- Element-UI Stylesheet -->
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/element-ui/1.1.6/theme-default/index.css" />
    </head>
    <body>
        <div id="app" class="content">

            {!! $demoTableView->render() !!}

        </div>

        <!-- Include Vue, Element-UI and Axios -->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.10/vue.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/element-ui/1.1.6/index.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js"></script>

        <!-- The table scripts will be added to this stack -->
        @stack('table-view-templates')
        @stack('table-view-scripts')

        <!-- Your Vue instance for this page -->
        <script type="text/javascript">
            new Vue({
                el: '#app',
            });
        </script>

    </body>
</html>

Setting-up the API endpoint

A few steps are required to support the searching and sorting features. To achieve this, we use the "Laravel 5 Repositories" by Andersao.

class ApiDemoController extends Controller
{
    protected $users;

    public function __construct(UserRepository $users)
    {
        $this->users = $users;
        $this->users->setPresenter(UserPresenter::class);
    }

    public function demoApi(Request $request)
    {
        $sort = $request->input('sort', 'name');
        $order = $request->input('order', 'asc');

        $this->users->orderBy($sort, $order);

        if ($request->has('search')) {
            $this->users->pushCriteria(new \Lykegenes\TableView\Criteria\SearchCriteria(['name', 'email'], $request->input('search')));
        }

        return $this->users->paginate($request->input('limit', 15));
    }
}

Credits

License

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

Related Packages

maka/datatable

Laravel datatable engine

50 0
livecontrol/eloquent-datatable

Eloquent DataTable plugin for server side ajax call handling.

276,683 54
mont4/laravel-filter

Laravel filter elequent

1,021 0
joydeep-bhowmik/livewire-datatable

A laravel livewire datatable package

95 0
eklundlabs/inertiajs-datatables

Laravel inertiajs datatables

3 1

Version History

Version Released Laravel License
v1.2.0 ~5.2|~6.0|~7.0|~8.0|~9.0 MIT
v1.1.5 ~5.2 MIT
v1.1.4 ~5.2 MIT
v1.1.3 ~5.2 MIT
v1.1.2 ~5.2 MIT