Wednesday, March 8, 2017

Bootstrap's thumbnails not displayed horizontally in Laravel 5.2

I'm trying to create a view where I show the bootstrap thumbnails on the same line, I've tried different methods and I'm showing thumbnails type list.

Here is my method in the controller:

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

        $files = File::where('property_id', $properties->id)->get();

        return view('properties.show', compact('properties', 'files'));
    }

This is my method in the view:

@foreach($properties->files as $index=>$file)

        <div class="row">
          <div class="col-sm-6 col-md-2">
            <div class="thumbnail">
              <img src="" alt="" width="300" height="200">
              <div class="caption">
                <div class="caption" align="center">
                    <button onclick="return confirm('Está seguro eliminar esta imagen?')" class="button btn btn-danger btn-xs" data-toggle="tooltip" data-placement="top" title="Eliminar"><i class="material-icons delete-white">delete</i></button>
                </div>
              </div>
            </div>
          </div>
        </div>

@endforeach

This way they are showing the images as thumbnails:

enter image description here

This should be the right way:

enter image description here

Can someone guide me to correct this small inconvenience?



via Edward Palen

Advertisement