Incorporating an infolist inside of an edit view modal?

As the title suggests, what would be the best way to incorporate infolist-type entries in the edit view? I know placeholders can work like this, but I'm not sure if I can make them work for my needs. I'm intending to create comments inside of an editable layout (see image), but these comments need to be able to be postable without being editable. My initial thought was to use a repeater, but these fields are editable throughout. Infolists came to mind as I currently utilize a personally modified variation of the plugin parallax comments (https://filamentphp.com/plugins/parallax-comments) in some of my infolists. While this would be a good solution, the editable form is in a modal and so does not come with the header actions and such that a typical layout would have, causing a need for creativity. Comments for view layouts in that plugin are themselves a modal, so unless I can create a modified version this also wouldn't work. Any suggestions would be appreciated!
No description
Solution:
Ok, I got it working. Ended up using the Livewire::make method, which is fantastic and really needs some coverage in the docs
Jump to solution
8 Replies
awcodes
awcodes5mo ago
What do you mean by postable but not editable? Not quite understanding the use case.
Steve_OH
Steve_OHOP5mo ago
The use case here is that comments can be left by users. In the context provided, any comment posted could be edited by other users since the only option I can think of would be a repeater field with some kind of readonly functionality
tim.lalev
tim.lalev5mo ago
You can make a livewire component with a custom form for the comments repeater. You can toggle visibility for that form based on event or just add a comment toggle button so that it will not be necessary to open yet another modal to interact with the comments
Steve_OH
Steve_OHOP5mo ago
Fantastic, thank you! Can you provide a resource for this functionality? I've created a few livewire components, but haven't found a reliable way to incorporate them into forms
Solution
Steve_OH
Steve_OH5mo ago
Ok, I got it working. Ended up using the Livewire::make method, which is fantastic and really needs some coverage in the docs
tim.lalev
tim.lalev5mo ago
Yeah custom livewire components are really great solution to so many usecases.
Steve_OH
Steve_OHOP5mo ago
For sure, I plan to use them a lot from here on!
Want results from more Discord servers?
Add your server