PHPackages                             asmit/resized-column - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. asmit/resized-column

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

asmit/resized-column
====================

Resizeable column for filament

v3.0.0(3mo ago)5195.3k↑22%12[2 issues](https://github.com/AsmitNepali/resized-column/issues)1MITPHP

Since May 17Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/AsmitNepali/resized-column)[ Packagist](https://packagist.org/packages/asmit/resized-column)[ Fund](https://www.buymeacoffee.com/asmitnepali)[ GitHub Sponsors](https://github.com/asmitnepali)[ RSS](/packages/asmit-resized-column/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (6)Dependencies (2)Versions (10)Used By (1)

Resizable Columns
=================

[](#resizable-columns)

The **Resizable Columns** plugin allows you to resize table columns in Filament with persistent width settings. This package provides a seamless way to customize table layouts by letting users adjust column widths according to their preferences.

[![Resized Column](https://raw.githubusercontent.com/AsmitNepali/resized-column/refs/heads/main/images/cover.jpg)](https://raw.githubusercontent.com/AsmitNepali/resized-column/refs/heads/main/images/cover.jpg)

Features
--------

[](#features)

- Drag-to-resize column functionality
- Persistent column width settings
- Per-user width preferences
- Session and database storage options
- Works inside **Filament panels** and in **standalone Livewire components**
- Easy integration with existing Filament tables
- Customizable storage mechanisms

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require asmit/resized-column
```

Registering the Plugin
----------------------

[](#registering-the-plugin)

Add the plugin to your Filament panel configuration in `app/Providers/Filament/AdminPanelProvider.php`:

```
use Asmit\ResizedColumn\ResizedColumnPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... other configuration
        ->plugins([
            // ... other plugins
            ResizedColumnPlugin::make()
                ->preserveOnDB() // Enable database storage (optional)
        ]);
}
```

Publishing filament assets
--------------------------

[](#publishing-filament-assets)

```
php artisan filament:assets
```

Publishing Migrations
---------------------

[](#publishing-migrations)

```
# Publish migrations
php artisan vendor:publish --provider="Asmit\ResizedColumn\ResizedColumnServiceProvider" --tag=resized-column-migrations

# Run migrations
php artisan migrate
```

Usage
-----

[](#usage)

To use the Resized Column functionality, simply include the `HasResizableColumn` trait in your Filament List Page or your custom page class. This will automatically enable the resizable column feature for all tables in that resource.

```
use Asmit\ResizedColumn\HasResizableColumn;

class ListUsers extends ListRecords
{
    use HasResizableColumn;

    protected static string $resource = UserResource::class;

    // Your existing table definition...
}
```

Storage Configuration
---------------------

[](#storage-configuration)

The package provides two storage mechanisms:

1. **Session Storage** (Enabled by default)

    - Stores column widths in the user's session
    - No database required
    - Storage is browser/device specific
2. **Database Storage** (Optional)

    - Stores column widths in the database
    - Requires migration to create the `table_settings` table
    - Works across browsers/devices for the same user

You can enable or disable database storage in your panel configuration:

```
ResizedColumnPlugin::make()
    ->preserveOnDB(true) // Enable database storage
```

Configuration Options
---------------------

[](#configuration-options)

You can override any of the following methods in your class to customize behavior:

MethodDescription`persistColumnWidthsToDatabase()`Customize how column widths are saved to database`persistColumnWidthsToSession()`Customize how column widths are saved to session`loadColumnWidthsFromDatabase()`Customize how column widths are loaded from database`loadColumnWidthsFromSession()`Customize how column widths are loaded from session`getUserId()`Customize how user identification is handledExample: Custom Database Storage
--------------------------------

[](#example-custom-database-storage)

```
use Asmit\ResizedColumn\HasResizableColumn;

class ListUsers extends ListRecords
{
    use HasResizableColumn;

    protected function persistColumnWidthsToDatabase(): void
    {
        // Your custom database save logic here
        YourCustomModel::updateOrCreate(
            [
                'user_id' => $this->getUserId(),
                'resource' => $this->getResourceModelFullPath(), // e.g., 'App\Models\User'
            ],
            ['settings' => $this->columnWidths]
        );
    }
}
```

Using Outside the Filament Panel
--------------------------------

[](#using-outside-the-filament-panel)

Filament tables can be used in any Livewire component without a panel. This package fully supports that use case. Add the `HasResizableColumn` trait to your Livewire component just as you would inside a panel.

```
use Asmit\ResizedColumn\HasResizableColumn;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;
use Livewire\Component;

class UsersTable extends Component implements HasForms, HasTable
{
    use InteractsWithForms;
    use InteractsWithTable;
    use HasResizableColumn;

    public function table(Table $table): Table
    {
        return $table
            ->query(User::query())
            ->columns([
                TextColumn::make('name'),
                TextColumn::make('email'),
            ]);
    }

    public function render(): View
    {
        return view('livewire.users-table');
    }
}
```

### Enabling Database Storage Outside the Panel

[](#enabling-database-storage-outside-the-panel)

Since there is no `AdminPanelProvider` to register the plugin, the package provides two alternative ways to enable database storage.

---

#### Option A — App-wide via `AppServiceProvider` (recommended for global config)

[](#option-a--app-wide-via-appserviceprovider-recommended-for-global-config)

Call `ResizedColumnPlugin::standalone()` once in `AppServiceProvider::boot()`. This stores a shared config instance for the entire request that all `HasResizableColumn` components will pick up automatically.

```
// app/Providers/AppServiceProvider.php
use Asmit\ResizedColumn\ResizedColumnPlugin;

public function boot(): void
{
    ResizedColumnPlugin::standalone()
        ->preserveOnDB();

    // Optionally disable session storage app-wide:
    // ResizedColumnPlugin::standalone()->preserveOnDB()->preserveOnSession(false);
}
```

---

#### Option B — Per table via Table macro (recommended for granular control)

[](#option-b--per-table-via-table-macro-recommended-for-granular-control)

Chain `->preserveColumnWidthsInDatabase()` at the end of your `table()` method. This only affects that specific table and overrides any global config.

> ⚠️ **Always call this as the last method in the chain**, after `->columns()`, `->filters()`, `->actions()`, and all other table configuration. This ensures the Livewire component reference is fully resolved when the macro runs.

```
public function table(Table $table): Table
{
    return $table
        ->query(User::query())
        ->columns([
            TextColumn::make('name'),
            TextColumn::make('email'),
        ])
        ->filters([...])
        ->actions([...])
        ->preserveColumnWidthsInDatabase();   // ← always last
}
```

You can combine both macros to fully control storage per table:

```
->preserveColumnWidthsInDatabase()      // save to DB
->preserveColumnWidthsInSession(false)  // disable session for this table
```

---

### Configuration Priority

[](#configuration-priority)

When the package decides whether to save column widths to the database, it checks configuration in the following order. **The first match wins.**

PriorityMethodScope**1 — Highest**`->preserveColumnWidthsInDatabase()` table macroSingle table only**2**`ResizedColumnPlugin::standalone()` in `AppServiceProvider`All components, no panel required**3 — Lowest**`ResizedColumnPlugin::make()` in panel providerInside a Filament panelThis means a table macro will always win over the global standalone config, which will always win over the panel plugin config.

---

Troubleshooting
---------------

[](#troubleshooting)

### CSS Styles Not Loading

[](#css-styles-not-loading)

If the resize handles are not displaying correctly:

1. Make sure you have published the Filament assets:

    ```
    php artisan filament:assets
    ```
2. Clear your browser cache or try a hard refresh (Ctrl+F5)

Credits
-------

[](#credits)

- [Asmit Nepal](https://github.com/AsmitNepali)
- [Kishan Sunar](https://github.com/Kishan-Sunar)

### Security

[](#security)

If you discover a security vulnerability within this package, please send an e-mail to . All security vulnerabilities will be promptly addressed.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### 📄 License

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.txt) for more information.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance78

Regular maintenance activity

Popularity46

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Recently: every ~73 days

Total

6

Last Release

116d ago

Major Versions

v1.1.0 → v2.0.02026-01-17

v2.1.0 → v3.0.02026-03-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/a319ef51eb11470bafa38ab183e1af21162a5d0ed09e48b0595482923816e782?d=identicon)[AsmitNepali](/maintainers/AsmitNepali)

![](https://www.gravatar.com/avatar/0839f88edc4763fccb1cf11fb7892e062ec454b06686baf7e08f7abdf0ecd264?d=identicon)[Kishan-Sunar](/maintainers/Kishan-Sunar)

---

Top Contributors

[![AsmitNepali](https://avatars.githubusercontent.com/u/33512152?v=4)](https://github.com/AsmitNepali "AsmitNepali (34 commits)")[![mansoorkhan96](https://avatars.githubusercontent.com/u/51432274?v=4)](https://github.com/mansoorkhan96 "mansoorkhan96 (2 commits)")

---

Tags

filament-pluginfilamentphplaravel

### Embed Badge

![Health badge](/badges/asmit-resized-column/health.svg)

```
[![Health](https://phpackages.com/badges/asmit-resized-column/health.svg)](https://phpackages.com/packages/asmit-resized-column)
```

###  Alternatives

[filament/filament

A collection of full-stack components for accelerated Laravel app development.

3829.6M3.6k](/packages/filament-filament)[filament/spatie-laravel-media-library-plugin

Filament support for `spatie/laravel-medialibrary`.

1806.0M194](/packages/filament-spatie-laravel-media-library-plugin)[filament/forms

Easily add beautiful forms to any Livewire component.

4831.0M417](/packages/filament-forms)[filament/tables

Easily add beautiful tables to any Livewire component.

3730.5M152](/packages/filament-tables)[filament/infolists

Easily add beautiful read-only infolists to any Livewire component.

1327.7M64](/packages/filament-infolists)[filament/notifications

Easily add beautiful notifications to any Livewire app.

2530.8M86](/packages/filament-notifications)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
