inivate/datatable-laravel

This package is created to handle server-side requests of DataTables jQuery Plugin via AJAX option.

dev-master 2022-01-18 05:28 UTC

This package is auto-updated.

Last update: 2024-09-18 11:19:30 UTC


README

Latest Stable Version Total Downloads Build Status Latest Unstable Version License

This package is created to handle server-side requests of DataTables jQuery Plugin via AJAX option. It uses DataTables jQuery Plugin

Installation

Install the package through Composer.

Run the Composer require command from the Terminal:

composer require inivate/datatable-laravel

Publish required files to project

php artisan vendor:publish --provider="Inivate\DatatableLaravel\DatatableServiceProvider"

If you're using Laravel 5.5, this is all there is to do.

Should you still be on version 5.4 of Laravel, the final steps for you are to add the service provider of the package and alias the package. To do this open your config/app.php file.

Add a new line to the providers array:

Inivate\DatatableLaravel\DatatableServiceProvider::class

Now you're ready to start using Laravel Datatables in your application.

Overview

Look at one of the following topics to learn more about Laravel Datatables

Usage

Laravel Datatables gives you the following methods to use:

(new DataTable(User::class, UserResource::class))
        ->addColumn('Id', 'id', true, true)
        ->addColumn('First Name', 'first_name', true, true)
        ->addColumn('Last Name', 'last_name', true, true)
        ->addColumn('Created At', 'created_at', true, true)
        ->build();