Download the PHP package hydrat/filament-table-layout-toggle without Composer

On this page you can find all versions of the php package hydrat/filament-table-layout-toggle. 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-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing users to switch between Grid and Table layouts.

Latest Version on Packagist Total Downloads

This package brings a simple toggle button to Filament tables, allowing end users to switch between Grid and Table layouts on tables. This approach allows mobile users to benefit from the Grid layout, while desktop users can still benefit from Table layout features, such as the table headers, sorting and so on.

Big shoutout to awcodes/filament-curator, which implemented the toggle feature first on their package. This package is mainly an extraction of the feature so that it can be used in any project, and some other adding such as saving the selected layout in the cache or local storage.

Migrating from 1.x to 2.x ? : Please read the migration guide.

Screenshots

Video capture

https://github.com/Hydrat-Agency/filament-table-layout-toggle/assets/11785727/b177a0fd-d263-4054-a05f-e6a597554d0f

Screen capture

screenshot_table screenshot_grid

installation

You can install the package via composer:

Optionally, you can publish the views using

If you are using this package outside of filament panels (standalone tables), you should publish the configuration file :

If using panels, this configuration file WILL NOT be read by the plugin, as the configuration happens on the plugin registration itself.

Usage

Please chose the appropriate section for your use case (Panels or Standalone tables).

Panels

First, register the plugin on your Filament panel :

Read more about the Layout persister and the configuration options in the Configuration section.

Please note that all those configurations are optional, and have default values, which means you can omit them if you don't need to change the default behavior.

Then, on the component containing the table (ListRecord, ManageRelatedRecords, ...), you can use the HasToggleableTable trait :

Finally, you need to configure your table so it dynamically sets the schema based on the selected layout. This is typically done on the resource's table() method :

Please note that you must use the Layout tools described in the filament documentation in order for your Grid layout to render correctly. You may also use the description() method to print labels above your values.

Standalone tables

You can manage the plugin settings via the published configuration file. The options are self-documented, and should be pretty straightforward to use.

Then, on the component containing the table, you can use the HasToggleableTable trait :

If you plan to persist the layout in the local storage, you must also change your view to include the needed assets :

Finally, you need to configure your table so it dynamically sets the schema based on the selected layout. This is typically done on the component's table() method :

Please note that you must use the Layout tools described in the filament documentation in order for your Grid layout to render correctly. You may also use the description() method to print labels above your values.

Configuration

Layout persister

The plugin proposes several persister classes to save the layout preference of the user :

The cache persister has several options, which you can toggle using the persistLayoutUsing method if using the Plugin in panels, or by changing the configuration file if using standalone tables.

You can also create your own persister by implementing the the LayoutPersister contract. The AbstractPersister class provides some default implementation which can be overridden if needed.

You can access the Livewire component using $this->component.

Change settings per-table

You may need to tweak some settings for a specific table only. This can be done by overriding the default methods provided by this package in the component you are using the HasToggleableTable trait in :

Using own action

If you rather use your own action instead of the default one, you should first disable it on the plugin registration :

Then, you can get and extend base Action or TableAction from the provided helper :

Changelog

Please see CHANGELOG for more information on what has changed recently.

Migration guide

Please see MIGRATION for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-table-layout-toggle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
filament/filament Version ^3.0
spatie/laravel-package-tools Version ^1.15.0
illuminate/contracts Version ^10.0|^11.0
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 hydrat/filament-table-layout-toggle contains the following files

Loading the files please wait ....