swindon/filament-hashids
Integrates Hashids with Filament so resource URLs use short, unique hash strings instead of sequential numeric IDs. Hide database keys, keep admin links cleaner and harder to guess, and configure encoding without changing your underlying schema or models.
This package lets a Filament panel route resources by Hashids instead of raw auto-increment IDs, so POST doesn't leak /admin/posts/42 to /admin/posts/jR4bYq9m. At v1.0.0 treat the API as stable but thin — read the source (src/) and the README first; there is no wiki or detailed changelog beyond the commit list.
Minimal setup:
composer require swindon/filament-hashidsphp artisan vendor:publish --tag="filament-hashids-config"app/Providers/Filament/AdminPanelProvider.php):public function panel(Panel $panel): Panel
{
return $panel
->id('admin')
->path('admin')
->plugin(HashidsPlugin::make());
}
First use case: enable it on a single low-risk resource in staging, click through list → view → edit → delete, and confirm the URLs contain hashes while Filament's internal links, relation managers, and global search results still resolve. If those all work, roll it out panel-wide.
config/hashids.php (or the package config) sourced from env('HASHIDS_SALT'). Set a minimum length long enough to look non-sequential — 8–16 is typical — and keep it constant per environment.vinkla/hashids style), define separate salts for tenant-scoped or high-sensitivity resources so a leaked salt doesn't expose every model.Model::resolveRouteBinding() / getRouteKey() or overrides Filament's record resolution. Verify it covers Route::resource bindings, Filament resource pages, and custom Route::get('/posts/{post}') if you mix them.route('filament.admin.resources.posts.edit', ['record' => $post]) — let the binding do the hashing rather than calling Hashids::encode() manually, otherwise you'll drift from the package's configured connection.->assertSuccessful() and on the resolved model, not on the literal hash string.edit_url in notifications will 404 after a salt change. Rotate deliberately, ideally with a redirect/fallback that resolves both old and new.0 or negative integers. Filament resources backed by id = 0 (rare) or composite keys will misbehave. Confirm the package handles this or falls back gracefully.spatie/laravel-sluggable, calebporzio/sushi, custom getRouteKeyName) are common. Pick one strategy per model; don't stack.resolveRouteBinding — an un-hashed ID or a double-hashed value (encoded twice via a manual encode() plus the plugin) is the usual culprit. Cache and config:cache can mask salt changes; clear both after touching HASHIDS_SALT.config('filament-hashids.enabled')) so you can disable hashing per environment without redeploying routes, and keep a rollback path to raw IDs during the transition.How can I help you explore Laravel packages today?