pepe.nectar
pepe.nectar
FFilament
Created by pepe.nectar on 10/29/2023 in #❓┊help
SpatieMediaLibraryImageEntry
I'm trying to use the SpatieMediaLibraryImageEntry with a model that has a belongsTo relationship and seems not to work. If I use te SpatieMediaLibraryImageEntry in an infolist of a model that implemens HasMedia, it works. It looks for a 'media' relationship and query it for getting the first image associated with the record. However, and here comes my problem, if I try to use SpatieMediaLibraryImageEntry in a model that have a belongsTo relationship with the model that has the media, it doesn't works. Suppose that I have the model Post which implements the HasMedia interface. And other model Comment, so posts can have many comments, and a comment belongs to a post. If I'm not using spatie media library, and post have a column called image, in a post resource/infolist, I can use an ImageEntry::make('image'), and in the case of using spatie media library, it will be SpatieMediaLibraryImageEntry::make('whatever') and the first image will be rendered. But in a comments infolist where I try to show only one comment and show the post image, without spatie ImageEntry::make('post.image') works, but when using spatie image library SpatieMediaLibraryImageEntry::('post') doesn't works. It looks like that it doens't tries to resolve the post relationship to use it as the record and look for the 'media' relationship in the post record. I'm start to think that is something that SpatieMediaLibraryImageEntry is not designed to work with. Any idea?
2 replies
FFilament
Created by pepe.nectar on 10/10/2023 in #❓┊help
Action inside a custom widget
No description
22 replies
FFilament
Created by pepe.nectar on 9/21/2023 in #❓┊help
Table action, update record from within javascript.
In a resources table I need an action that interacts with a javascript library which uses data from the row record, and update that record back to the db. Is a task that I don't know how to achieve, I think that has to be done interacting with the livewire object in js but I don't know how to pass the record to it and after the js interaction update it's fields back. Specifically I'm trying to interact with the Metamask extension via the wagmi js library, and I need to use data stored in a table record, and after the interaction with Metamask I need to store the results back to the table row. I think that the way is to create a custom action, but I can't find an example that depicts that scenario. Any idea? Thanks in advance.
5 replies