PHP code example of asmit / resized-column

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

    

asmit / resized-column example snippets


use Asmit\ResizedColumn\ResizedColumnPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            ResizedColumnPlugin::make()
                ->preserveOnDB(), // optional — database persistence
        ]);
}

use Asmit\ResizedColumn\HasResizableColumn;

class ListUsers extends ListRecords
{
    use HasResizableColumn;

    protected static string $resource = UserResource::class;
}

public function table(Table $table): Table
{
    return $table
        ->columns([
            TextColumn::make('name')->sticky(), // pinned by default
            TextColumn::make('email'),
            TextColumn::make('created_at'),
        ])
        ->dragReorderableColumns()
        ->stickableColumns();
}
bash
php artisan vendor:publish --provider="Asmit\ResizedColumn\ResizedColumnServiceProvider" --tag=resized-column-migrations
php artisan migrate