PHP code example of tiknil / wire-table

1. Go to this page and download the library: Download tiknil/wire-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/ */

    

tiknil / wire-table example snippets


class UsersTable extends WireTable
{
    public function query(): Builder
    {
        return User::query();
    }

    public function columns(): array
    {
        return [
            Column::create(
                label: __('backend.created_at'),
                key: 'created_at',
                sort: true
            ),
            Column::create(
                label: __('backend.name'),
                key: 'name',
                sort: true
            ),
            Column::create(
                label: __('backend.email'),
                key: 'email',
                sort: true
            ),
        ];
    }
}
bash
php artisan vendor:publish --tag=wiretable:config # Config file
php artisan vendor:publish --tag=wiretable:views  # Blade views
php artisan vendor:publish --tag=wiretable:lang   # Lang translation files
bash
php artisan make:wiretable UsersTable