fluidtech/spock-datatables

There is no license information available for the latest version (dev-master) of this package.

JQuery DataTables.net API for Laravel 5+

dev-master 2020-01-05 09:33 UTC

This package is auto-updated.

Last update: 2024-05-05 19:14:08 UTC


README

A laravel package to handle the server side processing of DataTables jQuery Plugin via AJAX option by using Eloquent Query Builder.

LICENSE.md LICENSE.md LICENSE.md LICENSE.md

Requirements

  • PHP >= 7.0
  • Laravel >= 5.5
  • jQuery Datatables v1.10x

Quick Installation

$ composer require fluidtech/spock-datatables

Add service provider

Register provider on you conifg\app.php file.

'providers' => [
    ...,
    \FluidTech\SpockDataTables\SpockServiceProvider::class
]

And that's it! Now you can start building out DataTables faster!

Documentation

  1. Using Eloquent Query Builder

    Fetches the and returns the records using the given query.

    Syntax

       $expectedResponse = \FluidTech\SpockDataTables\DataTable::of($query, $list_of_columns)
           ->make();
    • Accepts
      • $query : The base query from which records needs to be fetched.
      • $list_of_columns : An list of column names that needs to be displayed.
        Note : The sequence of columns should be the same as specified on the client side.

    Example

    $query = DB::table('users');
    
    return \FluidTech\SpockDataTables\DataTable::of($query, [
            "name", 
            "phone_number"
        ])
        ->make();
  2. Using Fluent Query Builder (Coming Soon)

  3. Using Collection (Coming Soon)

License

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