PHP code example of aayaresko / laravel-table

1. Go to this page and download the library: Download aayaresko/laravel-table library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aayaresko / laravel-table example snippets


$ php composer.phar 

"aayaresko/laravel-table": "^1.0"

$table = new TablesFacade($data_provider, $attributes, $default_actions_route);

$table = new TablesFacade(
    $data_provider, 
    [
        'nickname',
        'email',
        'profile.full_name',
        'created',        
    ], 
    $default_actions_route
);

$table = new TablesFacade(
    $data_provider, 
    [
        'Alias' => 'nickname',
        'email',
        'Full name' => 'profile.full_name',
    ], 
    $default_actions_route
);

$table = new TablesFacade(
    $data_provider, 
    [
        'nickname',
        'email',
        'profile.full_name',
        'created',   
        'alias' => function ($model) {
            return $model->alias;
        }
    ], 
    $default_actions_route
);

'show' => [
    'title' => '<i class="glyphicon glyphicon-eye-open"></i>',
    'route' => 'backend.accounts',
],
'edit' => [
    'title' => '<i class="glyphicon glyphicon-pencil"></i>',
    'route' => 'frontend.accounts',
],
'destroy' => [
    'title' => 'My button content',
    'url' => 'backend/accounts/destroy'
    'options' => [
        'class' => 'delete-ajax',
    ]
]