Download the PHP package tima/filament-column-order without Composer
On this page you can find all versions of the php package tima/filament-column-order. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tima/filament-column-order
More information about tima/filament-column-order
Files in tima/filament-column-order
Download tima/filament-column-order
More information about tima/filament-column-order
Files in tima/filament-column-order
Vendor tima
Package filament-column-order
Short Description Reusable Filament widget for saving/reordering table columns
License MIT
Package filament-column-order
Short Description Reusable Filament widget for saving/reordering table columns
License MIT
Please rate this library. Is it a good library?
Informations about the package filament-column-order
Filament Column Order Widget
Пакет для Filament, який дозволяє змінювати порядок колонок у таблицях через drag & drop та зберігати його у базі даних.
Встановлення
- Встановити пакет:
composer require tima/filament-column-order
2.Опублікувати ресурси та міграції:
php artisan vendor:publish --tag=filament-column-order-views
php artisan vendor:publish --tag=filament-column-order-migrations
php artisan migrate
Використання
1. Додати віджет у Resource:
use Tima\FilamentColumnOrder\Widgets\ColumnsOrderWidget;
protected function getHeaderWidgets(): array
{
return [
ColumnsOrderWidget::make([
'labels' => [
'id' => 'ID',
'title' => 'Назва',
'active' => 'Статус',
],
'key' => 'products_table_columns',
]),
];
}
Це створить drag & drop віджет для сортування колонок.
2. Використовувати порядок колонок у Table
use Tima\FilamentColumnOrder\Widgets\ColumnsOrderWidget;
use Filament\Tables\Columns\TextColumn;
use Archilex\ToggleIconColumn\Columns\ToggleIconColumn;
$allColumns = [
'id' => TextColumn::make('id')->label('ID')->sortable()->searchable(),
'title' => TextColumn::make('title')->label('Назва'),
'active' => ToggleIconColumn::make('active')->label('Статус'),
];
$order = ColumnsOrderWidget::getOrder('products_table_columns', array_keys($allColumns));
$table->columns(ColumnsOrderWidget::sortColumns($order, $allColumns));
3. Drag & Drop
Віджет автоматично підключає SortableJS
і дозволяє змінювати порядок колонок. Порядок зберігається у таблиці setting_columns.All versions of filament-column-order with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.2
illuminate/support Version >=11.0
illuminate/database Version >=11.0
filament/support Version ^3.3
filament/forms Version ^3.3
filament/tables Version ^3.3
filament/notifications Version ^3.3
filament/actions Version ^3.3
filament/widgets Version ^3.3
illuminate/support Version >=11.0
illuminate/database Version >=11.0
filament/support Version ^3.3
filament/forms Version ^3.3
filament/tables Version ^3.3
filament/notifications Version ^3.3
filament/actions Version ^3.3
filament/widgets Version ^3.3
The package tima/filament-column-order contains the following files
Loading the files please wait ...