How to hide an image URL in laravel? so if you wish to hide the image URL from the image tage in the browser inspection, I will tell you how to remove the image URL, and instead of the image url, we will add base64 encode code for the show image in the laravel application.
Sometimes clients do not want to show the image URL from where to coming or want to hide the image file source URL form the URL or publically, that time this post will help you.
I have below made a code example that code will replace the image URL with base64 code and will show the image using this base64 code. so that our image URL will hide and not be able to see publically.
$path = Storage::disk('public')->url('profile/profile-image.jpg'); $type = pathinfo($path, PATHINFO_EXTENSION); $data = file_get_contents($path); $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); <img src="{{ $base64 }}" alt="image">
We always thanks to you for reading our blogs.

Dharmesh Chauhan
(Swapinfoway Founder)Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us

Haresh Chauhan
(Co-Founder)We Are Also Recommending You :
- How To Filter In Laravel Query Example
- Laravel 10 Http Guzzle Request Crud Example
- Laravel 6 REST API with Passport Tutorial
- How To Convert HTML To Image/PDF Using Snappy In Laravel 9
- Error : You need to install the imagick extension to use this back end
- Single Session User Login in Laravel
- Laravel-9 Multi Authentication Guard Passport API Example
- Laravel 6 - Preview and Crop Image Before Upload using Ajax
- Laravel Adding Social Media Share buttons Advanced Tutorial Example
- Laravel 10 Create Custom Helper Function Example