Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Autosave Laravel Package

yousefaman/filament-autosave

Filament Autosave adds automatic form saving to Filament v4 and v5. Edit page changes are saved after a debounce with a status indicator and one-step Undo, while Create and custom pages keep unsubmitted work as a Laravel Cache draft users can restore or discard.

View on GitHub
Deep Wiki
Context7

Getting Started

Install and confirm the matrix. The package requires PHP 8.2+, Filament v4 or v5, and a matching Livewire major (v3 with Filament v4, v4 with Filament v5). CI only covers Laravel 12 and 13 — Laravel 11 will be refused by Composer 2.9+ anyway. If you are still on Filament v3 or Laravel 11, stop here.

composer require yousefaman/filament-autosave

There is no mention of migrations in the README, which fits the design: Edit-page saves go straight to your existing table, and Create-page drafts live in the Laravel Cache. Check for a publishable config (php artisan vendor:publish --tag="filament-autosave-config") and read that file first — the debounce interval, cache TTL, and cache key/prefix options are the knobs you will actually touch.

Where to look first:

  1. The config file after publishing — debounce, draft TTL, and whether the indicator/undo are globally toggleable.
  2. The trait or base-page class the package exposes for Edit pages. That one line added to a page class is the whole integration.
  3. vendor/yousefaman/filament-autosave/src for the actual save call — specifically whether it invokes the full save() lifecycle (mutations, validation, events) or a narrower write. This determines almost every caveat below.

First use case: a long-form EditRecord page — an article, product description, or settings page — where a user typing for ten minutes and losing it to a session timeout is a real support ticket. Add the trait to that one resource page, leave everything else untouched, and watch the indicator change state as you type. Do this on a throwaway record before rolling it out.

Implementation Patterns

Scope autosave per page, not globally. Because the behaviour is opted into on the page class, resist the urge to add it to a shared base EditRecord. Different resources have wildly different side effects on save (emails, webhooks, stock decrements). Enable it surgically on content-shaped forms.

Edit pages are the low-risk path. Changes are written to the database after a debounce, so the user's mental model is "it's already saved." That means you must make the server-side effects of a save idempotent and cheap. If your EditRecord fires a notification, a Slack webhook, or a updated observer that recomputes aggregates, autosave turns one save into dozens. Either move those side effects behind an explicit "Publish"/"Confirm" action outside the autosaved form, or detect autosave-originated saves and skip them.

Create pages are the draft path. Unsubmitted changes go to Laravel Cache, and on return the user gets Restore or Discard. Treat this as a convenience, not durability: drafts are cache entries, so a cache:clear, a deploy that flushes Redis, or a driver swap silently drops them. Set a TTL you are comfortable explaining to a user, and if drafts matter for compliance or long editing sessions, mirror them to a real table yourself.

Custom pages need the form plumbing wired up. The package handles the draft mechanism, but your page still needs a Filament form with state that survives hydration. Test restore/discard explicitly on custom pages — this is the least-trodden path in a young package.

Pair with an explicit save button. Autosave works best as a safety net beside a normal Save action, not as a replacement. Users still want a deliberate "done" gesture, and it gives you a clean place to hang validation, notifications, and redirects.

Keep the indicator honest. The visual status indicator is the whole UX contract. If a save fails validation, the user must see it — a green "Saved" that is actually a silently rejected partial payload is worse than no indicator at all. Verify the failure states in the source before trusting the UI.

In tests, disable it. Autosave makes Livewire tests non-deterministic (extra requests, race conditions against assertions). Toggle it off through config in your base test case, then write one or two dedicated tests that enable it and assert the draft cache key and the debounced write.

Gotchas and Tips

Validation on partial state. Users type an invalid intermediate value constantly — a half-typed email, a negative number. If the autosave path runs full validation, failed saves may be silent or noisy depending on implementation. Check exactly what happens and decide whether to debounce longer, validate only on the autosaved subset, or surface the failure in the indicator.

Observers and events fire — loudly. Autosave multiplies model events. spatie/laravel-activitylog, audit trails, and search indexers will all churn. Consider saveQuietly-style paths, event throttling, or excluding autosaved fields from your log's logOnly list.

Undo is one step and ephemeral. It is a convenience for "I just overwrote that paragraph," not a version history. It will not survive navigation, and it will happily revert other people's concurrent writes if the snapshot is stale. Do not let anyone believe it replaces a revisions package.

Last-write-wins across tabs. Two tabs on the same record will fight, and the loser gets no warning. If that matters, add your own updated_at-based staleness check before the autosave write.

Authorisation. Autosave must respect the same policies as a manual save. Confirm the write path goes through Filament's normal authorization rather than a raw model update, especially if field-level visibility differs between roles.

File uploads and repeaters. Temporary uploads, rich editors, and large repeaters produce heavy Livewire payloads; a short debounce on a repeater-heavy form will hammer your server. Measure with the network tab before shipping, and consider excluding those forms from autosave entirely.

Cache driver matters. File cache on a single node is fine for a demo; multi-server deployments need Redis or database cache with a consistent prefix, or drafts will appear and vanish depending on which node serves the request.

Maturity tax. Three stars, zero dependents, and a first release inside the last year. Pin the version exactly in composer.json, read the save path in src before trusting it in production, and wrap the trait behind your own base page class so swapping the package out later is a one-file change.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin