Laravel-medialibrary: getUrl() doesn't include port number when using with local php server

Created on 29 Sep 2018  路  3Comments  路  Source: spatie/laravel-medialibrary

Hey guys, thanks for the great library.

I'm facing this issue when developing locally with the php server, I expect the getUrl() function to return something like this:
http://localhost:8000/storage/1/filename.jpg

However, it doesn't include the port number and gives me this instead:
http://localhost/storage/1/filename.jpg

Any idea how I can fix this?

Most helpful comment

Hi,

Have you tried to change the APP_URL from APP_URL=http://localhost to APP_URL=http://localhost:8080 in the .env file?

Regards,

All 3 comments

Hi,

Have you tried to change the APP_URL from APP_URL=http://localhost to APP_URL=http://localhost:8080 in the .env file?

Regards,

Thank you very much @szana8 , that fixed it.

Hello there,

This doesn't seem to fix the problem for me. Any ideas of how can I fix it?

Thanks

Was this page helpful?
0 / 5 - 0 ratings