Handling Eloquent Query Builder Serialization Securely Between Components
I'm building a Kanban board package with Filament and Livewire. My architecture has a Filament Page that creates an Eloquent query builder which is passed to a Kanban adapter, and then the adapter is passed to a Livewire component.
However, I'm hitting both serialization and security roadblocks: when Livewire attempts to hydrate/dehydrate the component state, it can't serialize the Eloquent query builder inside my adapter. Additionally, I'm concerned about securely handling database queries across component boundaries.
I've considered:
However, I'm hitting both serialization and security roadblocks: when Livewire attempts to hydrate/dehydrate the component state, it can't serialize the Eloquent query builder inside my adapter. Additionally, I'm concerned about securely handling database queries across component boundaries.
I've considered:
- A registry pattern with server-side cache storage (most secure but adds complexity)
- Custom serialization of query parameters (concerned about exposing query structure)
- Stateless API-like approach with Alpine.js (better security boundaries)
- Rebuilding queries on each request (potential for query parameter manipulation)