0
votes

Currently, the Laravel app is saving correctly on MyProject/public/storage but the image on the app is always broken. If I save the images on MyProject/storage/ directory it works, I think there is a config I need to update.

If I update APP_URL and use php artisan serve, there are no issues. But when I try to deploy it on xampp, the issue occurs.

please help

here is the directory details:

xampp/
├── htdocs/ (public folder)
│   ├── MyProject/ 
│       ├── storage/
│       ├── .htaccess
├── MyprojectCore/
│   ├── public/
|       ├── storage/ 
│       

filesystem.php

'disks' => [

        'local' => [
            'driver' => 'local',
            'root' => storage_path('app'),
        ],

        'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

        's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'url' => env('AWS_URL'),
        ],

    ]

voyager.php

'storage' => [
        'disk' => 'public',
    ],

.env

APP_URL=http://localhost:8080/MyProject

index.php

require __DIR__.'/../../ECRCore/vendor/autoload.php';
$app = require_once __DIR__.'/../../ECRCore/bootstrap/app.php';
1

1 Answers

0
votes

This sounds like an incorrect APP_URL setting. Are you sure that the address is completely identical when using XAMPP and artisan serve?

I've also seen images disappear because one address was in HTTP and the other HTTPS. So keep this in mind.