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!
Solution:Jump to solution
Ok, I got it working. Ended up using the Livewire::make method, which is fantastic and really needs some coverage in the docs
8 Replies
What do you mean by postable but not editable? Not quite understanding the use case.
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
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
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
Ok, I got it working. Ended up using the Livewire::make method, which is fantastic and really needs some coverage in the docs
Yeah custom livewire components are really great solution to so many usecases.
For sure, I plan to use them a lot from here on!