Answer the question
In order to leave comments, you need to log in
Why is the output image not displayed in Laravel v5.8 with pagination?
The picture is in public/images/pictures here
Model:
class Crud extends Model
{
protected $table = "sample_data";
protected $fillable = [
'first_name', 'last_name', 'image'
];
}
public function index()
{
$data = Crud::latest()->paginate(5);
return view('index', compact('data'))
->with('i', (request()->input('page', 1) - 1) * 5);
}
@foreach($data as $row)
<tr>
<td><img src="{{ URL::to('/') }}/images/{{ $row->image }}" class="img-thumbnail" width="75" /></td>
<td>{{ $row->first_name }}</td>
<td>{{ $row->last_name }}</td>
<td>
</td>
</tr>
@endforeach
Answer the question
In order to leave comments, you need to log in
Try this
<img src="{{ asset('images') }}/{{ $row->image }}" class="img-thumbnail" width="75" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question