How to fix broken image issue in Bagisto?

Updated 17 May 2023

Sometimes we face broken image issues when we make some changes on the server with the existing Bagisto application. In this article, we are going to cover how to fix the broken image issue in Bagisto

Please find the below situation that creates image broken issues.

1. We didn’t run php artisan storage:link the command on the root of the project folder.
2. Sometimes specified wrong APP_URL path in .env file.
3. Sometimes we have renamed our Bagisto project folder after the running php artisan storage:link command.

So you can fix the image broken issue by the below steps.

Solutions:-

A. Firstly, we need to check the APP_URL path in .env file and make sure the specified path is correct.

Your APP_URL path should be up to the public folder inside the .env file like below.
APP_URL=http://localhost/bagisto/public

If you are running your project using ‘php artisan serve‘ then the specified APP_URL path should be ‘http://127.0.0.1:8000’ or ‘http://localhost:8000’.

After making the changes in the .env file we should always run the below command.

Command – php artisan config:cache

B. Second, we need to unlink the storage with the below command from the root of the project folder.

Command – rm -rf  public/storage

C. Then link it again with storage by the below command from the root of the project folder.

Command – php artisan storage:link

D. If still facing an image broken issue please clear your browser cache and run the below command on the root of the project folder.

php artisan config:clear
php artisan view:clear
php artisan cache:clear
php artisan vendor:publish –force

Thank you for reading this tutorial. We hope you found it helpful. If you have any questions or encounter any issues, please feel free to leave a comment below.

Feel free to hire Laravel developer to build your custom solutions on laravel.
For exploring the available extensions for Bagisto, you can check out bagisto.com.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home