Voyager: The avatar doesn't show image

Created on 24 Feb 2018  路  26Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.5.*
  • Voyager Version: ^1.0
  • PHP Version: 7.1.3
  • Database Driver & Version: MySQL

Description:

I have followed all the instruction on the internet already but none of them can solve.

  1. php artisan storage:link
  2. change the APP_URL: http://localhost:8000 to http://127.0.0.1:8000

Could you please propose any alternative solution to this issue?

Steps To Reproduce:

Most helpful comment

didn't.. haha
now, it is working. thanks a lot for your help!

All 26 comments

Hi! Can you tell href of image?

As @ArtemMolotov has requested, please share the URL for your site (I'm guessing http://localhost:8000/admin/) and the URL/href for the image that's broken.

Here's my URL for my site: http://127.0.0.1:8000/admin

screenshot 15

@hourdev Can you open image if you delete /public from image href?

go to config/filesystem.php and check if the public url is same as this one.

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

@ArtemMolotov that works if i delete /public. So, what should I do next?

@simoebenhida already tried but nth has changed

can i see your public url on config/filesystem.php and your variable APP_ENV on .env

d
s
@simoebenhida

yes on your filesystem.php public array replace 'public' => 'url' with this
'url' => env('APP_URL').'/storage', and it will work

still doesn't work

can i see the new filesystem.php changements

s

yes remove public from 'local' => 'url' too

or is better to remove it you dont need url on your local driver its already called on public driver.

screenshot 17
screenshot 18
still doesn't work

yes. already removed, but doesn't work

did you already run php artisan config:cache by any chance ?

didn't.. haha
now, it is working. thanks a lot for your help!

i meet the same question and i did all you said,however it still doesn't work

albeit this is closed, people are still having an issue. the solution for me was to remove the symlink in the public folder, then ensure the URL was correct in the .env file

APP_URL=http://your-app.test

As this constant is used in the config/filesystems.php file

'url' => env('APP_URL').'/storage',

the storage folder is appended the URL, so a forward slash is required before storage

so the url will be http://your-app.test/storage

Then navigate to the voyager dashboard and an alert will be there to fix the symlink, once clicked it worked for me.

'disks' => [

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

    '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'),
    ],

],

Dose not working please help

After deleting the public/storage ( if any ) folder run the command
php artisan storage:link
php artisan config:cache

And finally re-run the server .
It works for me .

  1. php artisan storage:link
  2. php artisan config:cache
  3. re-run the server

It worked for me. Thank you @arshomashohag

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MikadoInfo picture MikadoInfo  路  3Comments

popica80 picture popica80  路  3Comments

Nagendra1421 picture Nagendra1421  路  3Comments

craigb88 picture craigb88  路  3Comments

TPRAsh picture TPRAsh  路  3Comments