Closed jakecausier closed 3 years ago
Hi @jakecausier,
Indeed, a custom resolver is what you'll need. In this case you could basically start with the default resolver included in this package and tweak it so it includes what you need in certain layouts.
Another option would maybe be to define accessor methods on your flexible layouts (you'll need to define them using custom layout classes) such as getMediaAttribute()
which would retrieve the data you're looking for just by accessing $layout->media
.
Hi there, this might be a little difficult to explain what I'm trying to do, but I hope it makes sense.
I'm currently using Laravel Jetstream with the Interia stack which utilises Vue to render page content. I was working to implement this package to return layout instances and create Vue components dynamically, which is working fine, but I need to return Images attached using the ebess/advanced-nova-media-library fields, which do not show in the attributes output (as they need to be accessed via. the getMedia function on the layout instance.
Is there a way to intercept what the layout outputs in the attributes field? I figure I can merge in some extra fields for my attached image to return the URLs I need for rendering. I had a look into casts and resolvers but it confused me.