Sorry it's me i'm so bad as english :(.
So that i want is:
I have 2 tables one for product and one for multiples_images.
I want to display the first of images per products and not all images per products.
I have do the relasionships like this:
//Image.php
public function image(){
return $this->hasOne(Product::class);
}
//Product.php
public function product(){
return $this->hasMany(Image::class);
}
After that i have do your query with eloquent.
$products = Product::with('image')->get();
But if i want to use your method i nedd to use this
$products->getRelations()['image'][0]->path
Because the dd() return me a big instance like the request instance. with relation
dd($products);
But i can't use this because the collection of instance does not exist because the query is a big instance like the request instance
$product->image->path;
Sorry it's very specific for thumbnails i don't want to display all images in one products box from home page.
I just will like to take the first occurence of product_id them references the id on table products.