Looking to hire Laravel developers? Try LaraJobs

laravel-vue-table maintained by kriptiko

Description
A Laravel package for handling requests from @kritpiko/vue-table component.
Author
Last update
2024/06/11 15:13 (dev-master)
License
Links
Downloads
220

Comments
comments powered by Disqus

Laravel VueTable

A Laravel package for handling requests from @kritpiko/vue-table component.

Installation

Add the package to your Laravel app using composer

composer require kriptiko/laravel-vue-table

Usage

Here's an example of a paginated Query Builder result:

use Kriptiko\VueTable\VueTableRequest;

class PostController extends Controller
{
    
    public function index()
    {
        $vtr = new VueTableRequest(Post::query());

        return $vtr->paginated();
    }

    ...

Using withCount

To use withCount, you need to define the relationships after a new VueTableRequest object is instantiated. So you usually just need to do something like the following example:

$vtr = new VueTableRequest(User::query());
$vtr->withCount('comments');
$paginator  = $vtr->paginated();

License

kriptiko/laravel-vue-table is open-sourced software licensed under the MIT license.

About Kriptiko

Kriptiko is a Creative Studio specialized in web development based in Matosinhos, Portugal.