How to access image inside public folder in Laravel 9

How to access image inside public folder in Laravel 9

Posted by Luke Beeno on July 17, 2022

How to access image inside public folder in Laravel 9

How to access image inside public folder in Laravel 9

Posted by Luke Beeno on July 17, 2022

There are a few ways to access an image in Laravel 9 to be displayed in your view page.

Here is one way:

Using the url helper

<img src="{{url('/images/paypal.webp')}}" alt="wecode101">

This is another way:

Using the url facade

<img src="{{ URL::to('/')}}/images/paypal.webp" alt="wecode101">

And another:

Using the asset helper

<img src="{{ asset('images/paypal.webp') }}" alt="wecode101"/>