Show Image Medias on Laravel + Vue 3 Inertia JS Frontend

Can someone tell me how to display media images on Vue's frontend? As far as I understand, if I use Blade PHP, I just need to call the images using
->images(string $role, string $crop = 'default', array $params = [])
->images(string $role, string $crop = 'default', array $params = [])
. However, how do I implement the same functionality in Vue? Here is my code.
No description
4 Replies
Mohime
Mohime4mo ago
should i make a change in how i parse the data from the controller to Vue's props so that the images function can still be accessed?
ifox
ifox4mo ago
You won't be able to call a PHP function on a Laravel model from vue, so you need to send the props you need yes. https://twillcms.com/docs/api/3.x/A17/Twill/Models/Behaviors/HasMedias.html#method_imagesAsArraysWithCrops would give you everything you need to work with the images in vue
ifox
ifox4mo ago
GitHub
GitHub - Codivores/tutorial-laravel-twill-inertia-vue3-vite-tailwind
Contribute to Codivores/tutorial-laravel-twill-inertia-vue3-vite-tailwind development by creating an account on GitHub.
ifox
ifox4mo ago
Codivores
Laravel / Twill / Inertia / Vite / Vue3 Composition API / TypeScrip...
Our attempt to build a CMS using Laravel and Twill for the back-end and Inertia with Vite, Vue 3 Composition API, TypeScript and Tailwind for the front-end.
Want results from more Discord servers?
Add your server