Search code examples
imagelaravel-8publicapp-folder

How to display image in my view blade from storage/app/public/student_img folder in laravel 8


I have stored the images inside the storage/app/public/student_img but am not able to fetch images using any method inside the blade.

my filesystem.php setting is
'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],
// this is the code

Fetching image like this src='storage/app/student_img/{{ $stud->photo }}'

Please help me.

Solution

  • Have you run :

    php artisan storage:link
    

    yet?

    If you have a folder at /storage/app/public/student_img in which you are saving uploaded files, then you would need to put a symlink to that folder within the /public folder.

    Once that has been done, you can then include an image from the /storage/app/public/student_img folder in your blade template using :

    <img src="{{url('student_img/image.png')}}">