FilamentF
Filament7mo ago
Mombei

Multiple filament (?) components in a single page

Hello, I'm looking for some design advice.

I would like to have a creation form, which would turn into an editing form on submit, would spawn a relation manager after running a job to generate the related models, and could open an infolist to show the details of a row, all on the same page.

Do you think Filament is equipped to deal with that kind of request, which does stray a fair bit from "admin panel", or otherwise what kind of tool am I looking for to make that kind of front-end?
I think Filament could do it (since all the bits I mentioned do exist in Filament), but I don't know what I need to design that could hold all those things going on at once. Is it a livewire component? Would I need to manually implement specific traits from the Filament contracts to make it work? Is this a different pattern from Active Record? I just really don't know..
Solution
I have since worked on other parts of the app while refining the model and went with a classic resource-page based design, I tackled making a custom page again and was eventually able to fit form, table and infolist in a single page by implementing the relevant interfaces (HasForms, HasTable, HasInfolists) and using the relevant traits (InteractswithForms, InteractswithTables and InteractswithInfolists).

The biggest thing that eventually made it click for me is that I didn't need to edit the record after creation at all, so just having a form create the record and customizing the creation process so that the created record is stored to a property on the Page and sent to the Table to get the related records was enough. Using the @if directive to conditionally show the selected record on the table fixed the Infolist throwing an error about a record not being set that was stumping me.

Filament really is a wonderful framework and I hope to learn even more about it to make even more functional components and better apps.

Thanks @Amiejah and @Hasan Tahseen for the guidance
Was this page helpful?