am developing a site using laravel and I am trying to retrieve images stored as a path in the database but my code only gets the name of the image and the price in the views. I suspect its how i am calling the images as laravel has stored them in the storage/public folder. Please help. Here is my code: @section('content')
<div class="container">
@foreach ($products->chunk(4) as $items)
<div class="row">
@foreach ($items as $products)
<div class="col-md-3">
<div class="thumbnail">
<div class="caption text-center">
<a href="{{ url('shop', [$products->slug]) }}"><img src="{{ URL::asset('public/' . $products->path) }}" alt="products" class="img-responsive"></a>
<h3>{{ $products->name }}</h3>
<div class="clearfix">
<div class="price pull-left"><p>{{ $products->price }}</p></div>
<a href="{{ url('shop', [$products->slug]) }}" class="btn btn-success pull-right" role="button">add to Cart</a>
</div>
</div> <!-- end caption -->
</div> <!-- end thumbnail -->
</div> <!-- end col-md-3 -->
@endforeach
</div> <!-- end row -->
@endforeach
</div> <!-- end container -->
Then in my controller: if($request->hasFile('file')){ $uploaded_file = $request->file('file');
// this get the original extention
$uploaded_file_ex = $uploaded_file->getClientOriginalExtension();
// the path to store the file
// I add the time at the begining to avoid overwritting the file if another file has the same name.
$filename = time().'.'.$uploaded_file_ex;
$path = $uploaded_file->storeAs('public', $filename);