Is it possible to preview multiple images in model show??
When I do $show->photos()->image() it throws an error "array to string conversion".
Thanks in advance.
if $show->photos() is a collection use first() method to display to the first image
example:
$show->photos()->first()->image_name
But I want to display all images...like in form where you have multipleImage
you have to loop the image collections
Well I tried $show->photos()->each()->image() and still got an error "parameter expects to be string, array given" I even tried your example and still got the same error...
So I found a workaround, I am not sure if it is a good approach but it is working.
If anyone have a better idea I will be glad to hear it.
Bellow is a snapshot of my code

i do that like you
这个方法也不错
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Well I tried $show->photos()->each()->image() and still got an error "parameter expects to be string, array given" I even tried your example and still got the same error...
This one worked for me, Just need to add a function __toString on Photo Model that returns the image path.
public function __toString()
{
return $this->path;
}
Most helpful comment
So I found a workaround, I am not sure if it is a good approach but it is working.
If anyone have a better idea I will be glad to hear it.
Bellow is a snapshot of my code