thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

Voyager::image helper returns old url #4769

Closed vkiranmaniya closed 3 years ago

vkiranmaniya commented 4 years ago

Version information

Description

Then i call Voyager::image helper to retrieve the thumbnail, It returns the old base url(APP_URL). It was working fine. It broked after we change domain name, migrated the website to another domain. I change APP_URL in .env file, Cleared the configuration cache by running php artisan config:cache

Steps To Reproduce

Steps to reproduce the behavior:

  1. Open the .env file and change APP_URL
  2. Clear the configuration cache3. Call the Voyager::image() helper and dd() the output

Expected behavior

It should reflact the APP_URL from .env file after changing

vkiranmaniya commented 4 years ago

Meanwhile, I found workaround to this issue. I used asset() helper as,

asset('storage/' . $product->getThumbnail($image, 'thumbnail-md')) //working
//Voyager::image($product->getThumbnail($image, 'thumbnail-md'));

I think there is issue with image() helper function

emptynick commented 4 years ago

I am 100% certain there is nothing wrong with Voyager::image. It simply calls Storage::disk(config('voyager.storage.disk'))->url($file) so I think there is something wrong with the disk you configured for Voyager.

vkiranmaniya commented 4 years ago

@emptynick I didn't make any changes to the disc configuration. The Application is running with default configurations. So the app should behave normally as aspected but it didn't.

vkiranmaniya commented 4 years ago

here is the config

'storage' => [
    'disk' => env('FILESYSTEM_DRIVER', 'public'),
],

in config/voyager.php file. It's untouched after publish vendor. so Voyager::image() helper should work normally. My concern is, I changed the APP_URL in .env but Voyager::image() helper is still taking the older one. I also cleared application cache and configuration cache.

alfrandhy commented 4 years ago

Screenshot from 2020-05-10 06-43-23 Sorry Guys can Help Me,

Why my url is multiple like that

MrCrayon commented 4 years ago

@alfrandhy please don't comment in unrelated issues with questions. If you need help with your Voyager integration you can join Voyager Slack chat.

dsaha1656 commented 3 years ago

I am having the same issue,

additionally i noticed route('route_name') also produce old url.

please have a look.

emptynick commented 3 years ago

route() is a Laravel method. We can't fix that here. My opinion still stands - we simply call Laravel methods/functions. There is a very very high chance something is cached that shouldn't.

Closing

github-actions[bot] commented 1 year ago

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.