Download the PHP package nazalas/laravel-persistent-table-filters without Composer

On this page you can find all versions of the php package nazalas/laravel-persistent-table-filters. 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 laravel-persistent-table-filters

Laravel Persistent Table Filters

Latest Version on Packagist Tests License

Automatically persist and restore table filter, sort, and search state per user in Laravel applications. Works great with Livewire.

The Problem

Users refine a table — searching, sorting, filtering — then navigate away or refresh. Everything resets. This package silently saves filter state as users interact and restores it automatically on the next visit. Optionally, users can also save named filter presets and switch between them.

Features

Installation

Publish and run the migration:

Optionally publish the config:

Usage

Livewire Component

Add the HasPersistentFilters trait, define a resource key and which properties make up your filter state:

That's the core usage. Filters now survive page refreshes automatically with no user action needed.

Disabling Auto-Persist

Set $autoSaveFilters = false on any component to prevent persistFilters() from writing to the database:

Clearing Persisted State

Wipes the auto-persisted record for the current user + resource. The next page load will start fresh (or fall back to a named default if one exists).


Named Presets (Optional)

On top of auto-persist, users can save and reload named filter configurations.

Saving a Preset

Loading a Preset

Deleting a Preset

Listing Presets

Example Blade UI for Presets


How Restore Priority Works

restoreFilters() follows this order:

  1. Auto-persisted state — the last state saved by persistFilters() (if any)
  2. Named default — a named preset marked is_default = true (if no auto state)
  3. Component defaults — the property values you declared in the class (if neither exists)

Using Without Livewire

The TableFilter model and scopes work independently of Livewire:


Configuration


Testing

Changelog

See CHANGELOG.md.

License

MIT. See LICENSE.


All versions of laravel-persistent-table-filters with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.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 nazalas/laravel-persistent-table-filters contains the following files

Loading the files please wait ...