Getting Entry with Asset but without S3 meta data #6036
Replies: 2 comments 1 reply
-
Hey @barnabas-szekeres! 👋 You could try using Laravel's Hope that helps! :) |
Beta Was this translation helpful? Give feedback.
-
Instead of immediately converting it all to an array, which will augment everything you've asked for, you could get the entries first and then just transform it into what you want. Similar to what you've already done. Something like this: Entry::query()
->get(['title', 'slug', 'assets_field'])
->map(function ($entry) {
return [
'title' => $entry->title,
'slug' => $entry->slug,
'thumbnail' => optional($entry->assets_field)->url,
];
}); Also, do you have the stache watcher enabled in See how it feels if you disable it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Folks,
Is there any solution to getting asset field url without meta data? I have an entry collection and these entires have thumbnails which are located on a S3 bucket. Unfortunately if query the
Entry
collection withthumbnail
field the request goes very slow. :(Example:
This query result contain the whole asset's meta data, which is totally unnecessary for me. I only need the
thumbnail.url
but the query builder doesn't reflect to that.What I want to achieve:
Versions
Statamic 3.3.11 Pro
Laravel 9
PHP 8.1
Beta Was this translation helpful? Give feedback.
All reactions