I have a table named files, this saves the name of the images related to the properties table.

I am trying to make these images appear as in the following relation.

This is part of the properties table.

[![enter image description here](https://i.stack.imgur.com/RptQb.png)](https://i.stack.imgur.com/RptQb.png)

This is the table files and their relationship to the properties table.

[![enter image description here](https://i.stack.imgur.com/3jHj3.png)](https://i.stack.imgur.com/3jHj3.png)

What parameter can I pass in the show method of my controller (PropertyController)?

Currently I have the following:

```
public function show($id)
{
 $properties = Property::find($id);

 $files = File::all();

 return View::make('properties.show', ['properties' => $properties, 'files' => $files]);
}

```

But it returns to the view all the images stored in the files table.

```
@foreach($files as $file) 

    <div class="col-md-6 thumb">
        <a class="thumbnail">
            <img id="myImg" src="{{ URL::asset('uploads/products/' . $file->name) }}" alt="{{ $file->name }}" width="300" height="200">
        </a>
    </div>

@endforeach

```

Which method would be correct so that the images related to the records can be displayed by id in the properties table?