Every company in my app has a folder that has the same name as the company name: Inside that folder there is a logo. public/filemanager1/costumers/companyname/logo/logo.jpg
I display the logo like this:
<img src="/filemanager1/klanten/{{$companyname}}/logo/logo.jpg" style="width:200px" class="img-thumbnail img-responsive" alt="Responsive image">
But it does not display so i tested to see if the path path was correct:
{{ 'filemanager1/klanten/'.$companyname.'/logo/logo.jpg' }}
I get this output:
/filemanager1/klanten/Klant28/logo/logo.jpg
I copy pasted this url in my browser and i do see the image in my browser:
http://localhost/laravel4_test2/public/filemanager1/klanten/Klant28/logo/logo.jpg
So i tried to paste the path in my view:
<img src="/filemanager1/klanten/Klant28/logo/logo.jpg" style="width:200px" class="img-thumbnail img-responsive" alt="Responsive image">
This does not yield anything. Can anyone see the error of my ways?
ALSO i see now that the filemanager that i used is not showing:
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var elf = $('#elfinder').elfinder({
// lang: 'ru', // language (OPTIONAL)
url : '/filemanager1/php/connector.php' // connector URL (REQUIRED)
}).elfinder('instance');
});
</script>
I must say recently i have moved my mysql data and htdocs folder to a google drive folder and changed the paths in xampp.
Could this have anything to do with it?
When i output storage_path() i get the right path:
C:\Google Drive\htdocs\laravel4_test2\app\storage
So that must be right. And DIR outputs:
C:\Google Drive\htdocs\laravel4_test2\app\storage\views
How do i check the public folder?
Your img src is incorrect, you have
/filemanager1/klanten/Klant28/logo/logo.jpg
but your site is prefixed with /laravel4_test2/public, so you should use
/laravel4_test2/public/filemanager1/klanten/Klant28/logo/logo.jpg
Maybe use {{ asset('filemanager1/klanten/'.$companyname.'/logo/logo.jpg') }}
, that will generate an absolute url.
Sorry barryvdh the answer was supposed to be for you. I thought because you were at the bottom you answered last. But you answered in 21 hours, elite123 answered in 22 hours.
Also your answer also took in account the possiblility i could move my project folder. (generatibg an absolute url.) When i move my folder to an other webserver i won't have any problems with the changing URL.
Thanx guys for your help.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community