0

I'm trying to show all images on my storage/app/livros folder on a view with this code below, but I get this like I have nothing there . How can I show these images?

@extends('layouts.app_cad_livros')
@section('content')
    <div class="textocs">
        <br>
        <h3>LIVROS</h3>
    </div>
    <div class="card_livro">
        @foreach($livro as $mostra)
            {{$mostra->users_id}}

            <img src="{{ url("storage/app/livros{$mostra->image}") }}"
                 style="max-width=100px;">

            TÍTULO   {{$mostra->namel}}<br>
            AUTOR {{$mostra->autor}}<br>
            EDITORA {{$mostra->editora}}<br>
            CATEGORIA {{$mostra->categoria}}<br>
            CLASSIFICAÇÃO {{$mostra->classificação}}<br>
            DESCRIÇÃO {{$mostra->descricao}}<br>
            CAPA {{$mostra->image}}<br>
        @endforeach
    </div>
    <a href="{{ url('/alugar', $mostra->users_id)}}">
        <button class="btn btn-primary">quero alugar</button>
    </a>
@endsection

this is the

<img src="{{ url("storage/{$mostra->image}") }}"  style="max-width=100px;">
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
Isabela Navarro
  • 61
  • 1
  • 1
  • 7

1 Answers1

0

You need to run the command:

php artisan storage:link

and to access the image:

 asset('storage/app/path/to/image')

try this

asset('storage/app/livros/'.$mostra->image.')

or

asset('storage/app/livros/{$mostra->image}')

You can get more info From Here

Doro
  • 347
  • 2
  • 6