Voyager: Images don't show up in views (front-end pages)

Created on 5 Nov 2017  路  5Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.5
  • Voyager Version: 1.0
  • PHP Version: 7.0.10
  • Database Driver & Version: MySQL 5.7.14

Description:

Image in views not working. I can see the image in the back-end when I browse the BREAD. However when I'm trying to display the image in my views it's not working even though the image link seems to be pointing to the correct directory. Following is the image URI -
http://localhost:8000/public/storage/about/November2017/about-1.jpg

I tried creating symlink but it still didn't work.

This is how my filesystems.php looks like -

'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_KEY'),
            'secret' => env('AWS_SECRET'),
            'region' => env('AWS_REGION'),
            'bucket' => env('AWS_BUCKET'),
        ],

Things already tried: created symlink, changed url in filesystems.php, visibility set to public

Working for a University project assignment. This is sort of urgent.

Steps To Reproduce:

1) Upload image
2) Try to display image in view (front end pages)

question user error

Most helpful comment

Are you using Voyager::image($item->image) ?
Your path looks wrong because theres still the public directory (if you remove it, it should be fine)

All 5 comments

Are you using Voyager::image($item->image) ?
Your path looks wrong because theres still the public directory (if you remove it, it should be fine)

Fantastic. It works after removing the public directory. How stupid of me. Thanks a lot!! :)

$p->images is an array?
And try {{ Voyager::image($p->image) }}

Your first solution worked. Thanks a lot buddy. :)

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

winex01 picture winex01  路  3Comments

popica80 picture popica80  路  3Comments

raoasifraza1 picture raoasifraza1  路  3Comments

craigb88 picture craigb88  路  3Comments

abacram picture abacram  路  3Comments