tobyselway
Custom data providers
Hi everyone,
What I'm trying to accomplish is to use Filament as a dashboard for an application structured as a Modular Monolith.
(This is a good example: https://github.com/avosalmon/modular-monolith-laravel)
I have multiples modules such as
Order
, Invoicing
, etc. and in a separate module named Dashboard
I'd like to install Filament.
The main limitation is that I cannot directly access Eloquent models across domain boundaries (modules), all accesses should be made through a common interface.
Looking at the Filament v3 docs I can't find any way of providing a Filament Resource with custom methods able to fetch the data it needs. I've only came across the getEloquentQuery()
method which expects me to return a Builder
object, and which I assume extensively uses the Eloquent query builder to populate the dashboard with whatever info it requires. However, the data I can obtain through my common interface cannot be an Eloquent Builder
object, most of the time it'll be an array of objects (DTOs) or similar, so I cannot return this data in the getEloquentQuery()
method.
Is there any way of providing Filament with my own source of data not backed by Eloquent?56 replies