I have tenancy for laravel installed in my project due to this my images are being uploaded correctly and storing in storage folder in specific tenant folder and then image name !! but how can i display this? for storage if i use storage_path it takes whole path from
file:///C:/wamp64/www/toplimo/toplimo_server/storage/tenanta21e21ae-e338-4355-9c20-686335d9dea6/logos/ehZImdggil6PTsuUBVQAQGNkCthdFFBUCYI4o7GT.jpg !!
so for storage i am just storing logos/name of image ! thats it but if i use storage_path while accessing then it gives this and says not allowed to load local resource !!
$path = $request->file('logo')->store('logo');
// Save the file name to the database
$company->logo = $path;
$company->save();
This is how i am saving data but if i use this for fetching profile details along with logo ———
$profile_data->company_logo = storage_path($company_details->logo);
it gives above link file:///C:/wamp64/www/toplimo/toplimo_server/storage/tenanta21e21ae-e338-4355-9c20-686335d9dea6/logos/ehZImdggil6PTsuUBVQAQGNkCthdFFBUCYI4o7GT.jpg and i am unable to use
$profile_data->company_logo = Storage::disk('logos')->path($company_details->logo);
help me to display it !! i want to display over here
if (this.profileData && this.profileData.company_logo) {
// Assuming your backend serves the logos from a specific URL, like '/logos/'
// You may need to adjust this URL based on your server setup
this.form.company.logo = 'http://domain1.localhost:8000/logos/' + this.profileData.company_logo.split('/').pop();
console.log(this.form.company.logo);
}
this.form.company.logo should display proper value and i am running server on domain1.localhost:8000
i dont want to publically make my images /logos available so it should pick from tenant only
YASHIMA AHUJA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.