laravelstorage

Laravel images in storage link are broken


In laravel i created storage using php artisan i cannot access my images on blade uploading works fine but i cannot even see them file they are broken. Even in using http://localhost:8000/storage/ProductId-1601294060.jpg laravel response is Not Found but images are there in the folder Steps i have tried

<td><strong><img  src="/storage/product_image/ProductId-1601296148.jpg" height="150px" width="150px"/></strong></td>

step 2

<td> <img src="{{ URL::asset('/storage/product_image/ProductId-1601296148.jpg') }}" ></a></td>

step 3

<td><img src="{{asset('/storage/product_image/ProductId-1601296148.jpg')}}" class="img-size-50 mr-3 img-circle"></td>

also in file config file system i have added

'default' => 'public'

thanks


Solution

  • Laravel storage filesystem is so unique. When you doing any upload it will upload in the storage/app/public directory. To make it accessible in public directory, things need to do is create symlink by run command:

    php artisan storage:link
    

    Or

    <img src="{{ Storage::url("/product_image/ProductId-1601296148.jpg") }}" alt="" />