A Laravel package for handling requests from @kritpiko/vue-table component.
Add the package to your Laravel app using composer
composer require kriptiko/laravel-vue-table
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();
}
...
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();
kriptiko/laravel-vue-table is open-sourced software licensed under the MIT license.
Kriptiko is a Creative Studio specialized in web development based in Matosinhos, Portugal.