mardi 29 décembre 2015

How to show image in index view page in laravel 5?

index.blade.php

I am using img src="{{ URL::asset($task->image) }}" to display image but its not working...please suggest me on how to achieve it..

@extends ('welcome')

@section ('content')
<h1 class="headng"> Form List </h1>
    <table class="table  table-hover ">
        <tr>
            <th><h4>Title</h4></th>
            <th><h4>Description</h4></th>
            <th><h4>Image</h4></th>
            <th><h4>Printable</h4></th>
            <th><h4>Actions</h4></th>
        </tr>
        @foreach($tasks as $task)
        <tr>
            <td>{{ $task->title }}</td>
            <td>{{ $task->description }}</td>
            <td><img src="{{ URL::asset($task->image) }}" /></td>
            <td>{{ $task->printable }}</td>
            <td>
                <a href = '{{ action('TasksController@edit',[$task->id]) }}'>Edit</a> |
                {!! Form::open([
       'method' => 'DELETE',
       'route' => ['tasks.destroy', $task->id]
   ]) !!}
                {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}
                {!! Form::close() !!}
            </td>
        </tr>
        @endforeach
    </table>
@stop



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire