Assets are a special type of Field with additional functionality. Where possible to try to detect the type of file upload and return an appropriate Field. Image
classes are returned when the file has one of the following extensions: ‘.jpg’, ‘.jpeg’, ‘.png’, ‘.gif’, ‘.webp’. See the Image documentation for more.
To check if a file has been uploaded in Storyblok call hasFile()
on the Asset.
$myAsset->hasFile();
{info} When using multi-asset fields we only receive a URL from Storyblok the Asset|Image fields are less complete.
Storyblok allows you to serve assets from their platform using a custom domain. You will need to define two configuration values in your storyblok
config file:
[
// rest of configuration
`asset_domain` => 'custom.asset.domain',
`image_service_domain` => 'custom.imageservice.domain'
]
The configuration to customise both domains is needed because:
{info} See Storyblok’s documentation on setting up the custom asset domains.
Thank you to Brent Mullen for this feature!