Download the PHP package asignua/filament-toggle-icon-column without Composer

On this page you can find all versions of the php package asignua/filament-toggle-icon-column. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-toggle-icon-column

Filament Toggle Icon Column

Stand With Ukraine

Filament Toggle Icon Column

Tests

A table column that is an icon you click: it flips a boolean attribute in place, with no switch and no page reload. The Filament 5 successor of archilex/filament-toggle-icon-column (which stopped at Filament 3).

Filament core has ToggleColumn (a switch) and IconColumn (read-only), but nothing that is an editable icon. This column adds the missing piece and keeps the core saving contract: validation, beforeStateUpdated/afterStateUpdated, disabled(), and, unlike the core editable columns, a model-policy check.

Screenshots

The column renders as a single clickable icon in the table cell (check-circle / x-circle by default), in light and dark mode:

List

List, dark mode

Hovering an enabled icon previews the state the click would produce:

Hover hint

Requirements

Installation

filament:assets publishes the small stylesheet that colours the icons (onColor(), offColor(), hoverColor()). The column is a plain class and needs no registration. Registering ToggleIconColumnPlugin::make() on a panel is optional and only marks the plugin as installed.

Usage

It works in resource tables and in relation managers (both use Filament's updateTableColumnState()).

Saving, validation and hooks

Same API as ToggleColumn:

Disabling and authorization

Core's editable columns only honour disabled(); this column also asks the policy, so a user who may not edit the record cannot flip it by crafting a Livewire call. The policy of every record the write touches is asked: the row, the related record for a relationship column (user.is_active), and a pivot that has its own policy. Semantics are Filament's own (get_authorization_response()): a model without a policy stays editable, a policy without the method allows, and the panel's strictAuthorization() is honoured (it throws for a missing policy).

Hover hint

By default, hovering (or focusing) an enabled icon previews the state the click would produce: the opposite icon, dimmed. Turn it off with ->hoverHint(false); ->hoverColor('warning') recolours the previewed icon. On a cell that cannot be clicked the state tooltip only reports the state. ->stateTooltip() adds a translated tooltip ("On. Click to turn off.") when you set none.

Accessibility

The icon is a role="button" with aria-pressed, aria-label (the column label), aria-disabled, aria-busy and aria-invalid; Enter and Space toggle it, and disabled icons leave the tab order.

Configuration

There is no config file; everything is a fluent setter on the column (see Usage). size() (an IconSize or 'xs'...'2xl'), hoverColor(), hoverHint(), authorize() and stateTooltip() are the additions over the core editable column API.

Gotchas

Translations

The interface ships in English, Ukrainian, German, Spanish, French, Italian, Dutch, Polish, Brazilian Portuguese and Turkish under the filament-toggle-icon-column::filament-toggle-icon-column namespace. A test keeps every language in step with the English keys. Override a string by publishing the translations (--tag=filament-toggle-icon-column-translations) and editing the copy in lang/vendor/filament-toggle-icon-column.

AI agents

The package ships Laravel Boost guidelines (resources/boost/guidelines/core.blade.php) so a coding agent wires it up correctly.

Testing

Changelog

See CHANGELOG.md.

More plugins by asign

All plugins: https://filamentphp.com/plugins?q=asign

License

The MIT License (MIT). See LICENSE.md.

Migrating from archilex/filament-toggle-icon-column

onIcon(), offIcon(), onColor(), offColor(), size('xl') and hoverColor() keep their names. Saving follows Filament 5's editable-column contract (updateStateUsing, beforeStateUpdated, afterStateUpdated, rules). New here: authorize(), hoverHint(), stateTooltip().


All versions of filament-toggle-icon-column with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
filament/filament Version ^5.11.2
illuminate/contracts Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package asignua/filament-toggle-icon-column contains the following files

Loading the files please wait ...