Question

How to get images to display on deployed laravel project on apps platform

I recently deployed a small laravel app on the digital ocean apps platfrom and images I had saved in my public/images folder are’t displaying. My image tag looks like so

<img alt="image" src="{{ asset('images/port_site.png') }}"/>

I am not sure if I am missing anything when it comes to the deployment or where these images should be located but everything looks correct on my end and the images display when I am building locally but once deployed they wont display.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
January 24, 2021
Accepted Answer

Hi there @blaynebennett99,

I could suggest a couple of things:

  • Check the exact error that you are getting in your web console, it could be due to mixed content. If this is the case, then what you could do is force HTTPS by editing the app/Providers/AppServiceProvider.php file and in the boot method add the following:
        if ($this->app->environment('production')) {
            \URL::forceScheme('https');
        }
  • Make sure that your images are present in the images folder.

Let me know how it goes! Regards, Bobby

Im having the issues with our Codeingitor PHP application. I dont get any error - the image is getting uploaded, but the image just wont show up in the front end. For example, the applications asks employees to upload their photo, they are able to upload, but image wont load. Please help!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.