2017 © Pedro Peláez
 

library datatable-model

A dedicated class (model) to configure Chumper's Datatable package for Laravel (https://github.com/Chumper/Datatable) to keep your controllers as clean as possible.

image

imade/datatable-model

A dedicated class (model) to configure Chumper's Datatable package for Laravel (https://github.com/Chumper/Datatable) to keep your controllers as clean as possible.

  • Thursday, May 14, 2015
  • by imade
  • Repository
  • 1 Watchers
  • 2 Stars
  • 97 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Datatable Model

This is a laravel 5 package for the server and client side of datatables at http://datatables.net/, (*1)

A dedicated class (model) to configure Datatables.net for Laravel to keep your controllers as clean as possible., (*2)

Example

Your Userscontroller:, (*3)


class UsersController extends \BaseController { /** * Display a listing of the resource. * * @return Response */ public function index() { $table = new UserDatatable(); if($table->dataRequest()) return $table->data(); return View::make('resource.index')->withTable($table); } }

Dedicated UserDatatable. This class is required to extend "Imade\Datatable\DatatableModel". The two methods "data" and "table" are required., (*4)


use Imade\Datatable\DatatableModel; class UserDatatable extends DatatableModel { public $columns = array( 'id' => '#', 'name' => 'Naam', 'email' => 'E-mail' ); public function data() { $query = User::select( array_keys($this->columns) ); return Datatable::query($query) ->showColumns( array_keys($this->columns) ) ->make(); } public function table() { return Datatable::table() ->addColumn( array_values($this->columns) ); } }

Install

  1. Install Datatable on: https://github.com/Chumper/Datatable
  2. Require Imade/Datatable in your composer.json:
    "imade/datatable-model": "dev-master"

The Versions

14/05 2015

dev-master

9999999-dev

A dedicated class (model) to configure Chumper's Datatable package for Laravel (https://github.com/Chumper/Datatable) to keep your controllers as clean as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar imade

laravel model datatable

07/08 2014

v0.1

0.1.0.0

A dedicated class (model) to configure Chumper's Datatable package for Laravel (https://github.com/Chumper/Datatable) to keep your controllers as clean as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar imade

laravel model datatable

07/08 2014

v1.0

1.0.0.0

A dedicated class (model) to configure Chumper's Datatable package for Laravel (https://github.com/Chumper/Datatable) to keep your controllers as clean as possible.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar imade

laravel model datatable