Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
This PR allows support for adding media in JSON repeaters. Media items for json repeaters are now saved in the mediables table role column in {$repeatedName}|{$repeaterIndex}|{$role} format.
Also added a helper method to easily get the role for a JSON repeater.
if (! function_exists('getJsonRepeaterMediaRole')) {
function getJsonRepeaterMediaRole($role, $repeaterName, $index): string
{
return "$repeaterName|$index|$role";
}
}
If you have a JSON repeater with medias named features, you can display the image like so:
Description
This PR allows support for adding media in JSON repeaters. Media items for json repeaters are now saved in the
mediables
table role column in{$repeatedName}|{$repeaterIndex}|{$role}
format. Also added a helper method to easily get the role for a JSON repeater.If you have a JSON repeater with medias named
features
, you can display the image like so: