2017 © Pedro Peláez
 

library datatables

Super useful package for managing your database from an admin panel.

image

devmi/datatables

Super useful package for managing your database from an admin panel.

  • Monday, March 26, 2018
  • by adamkeen
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1 Installations
  • Vue
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

DataTable

Useful package for managing your database from an admin panel., (*1)

Installation

Step 1: Composer

From the command line, run:, (*2)

composer require devmi/datatables

Step 2: Service Provider

If you're using laravel >5.5 skip to the next step., (*3)

Open config/app.php and within the providers array:, (*4)

Devmi\Datatables\DataTableServiceProvider::class

Step 3: Controller

For this package to function properly, you must create a controller extends our base DataTableController., (*5)

e.g:, (*6)

php artisan make:controller UserController

then, you must implement the abstract builder function, (*7)

use App\User;
use Devmi\Datatables\Controllers\DatatableController;


class UserController extends DatatableController
{
    public function builder()
    {
        return User::query();
    }

    //...
}

Step 4: Route

Simply add resources route., (*8)

Open routes/web.php , add:, (*9)

Route::resource('users', 'UserController');

Step 5: vendor puslish

Now you must publish the vue compenents and register it in order to use it., (*10)

php artisan vendor:publish --tag=devmi

open resources/assets/js/app.js and register the component, (*11)

Vue.component('data-table', require('./vendor/devmi/DataTable.vue'));

you find the file under resources/assets/js/vendor/devmi/DataTable.vue , you customize it., (*12)

Usage

Now you can visit www.domain.com/admin/users, (*13)

'users' is you table name., (*14)

Imgur, (*15)

  • Repeat step 3 & step 4 for your other model.

Notice

You must to install ES6 spread operator in order to use this package properly, (*16)

npm install --save-dev babel-plugin-transform-object-rest-spread

then, create .babelrc file from you command line, (*17)

echo '{ "plugins": ["transform-object-rest-spread"] }' > .babelrc

Now compile your asset running, (*18)

npm run dev

Extra

Example:

You can override the following functions and variables for your need, (*19)

/**
 * Allows admin to add new record on database
 */

$allowCreation: Bool
public function getDisplayableColumns()
{
    return ['columns', 'you', 'need', 'to', 'display'];
}
public function getUpdatableColumns()
{
    return ['updateable', 'columns'];
}
public function store(Request $request)
{
    // Add validation for example
    parent::store($request);
}
public function update($id, Request $request)
{
    // Add validation for example
    parent::update($id, $request);
}

The Versions

26/03 2018

dev-master

9999999-dev

Super useful package for managing your database from an admin panel.

  Sources   Download

MIT

The Requires

 

by Mohamed Miloudi

laravel vue datatable admin panel

26/03 2018

1.1

1.1.0.0

Super useful package for managing your database from an admin panel.

  Sources   Download

MIT

The Requires

 

by Mohamed Miloudi

laravel vue datatable admin panel

01/10 2017

1.0

1.0.0.0

Super useful package for managing your database from an admin panel.

  Sources   Download

The Requires

 

by Mohamed Miloudi