It's not the ideal fix, but this will avoid the usage of APP_URL by asset().
Generated paths are now relative;
Side note;
@pxpm I'm happy to tell you that this PR also fixes the last double slash issue 😅
Why isn't this the ideal fix?
Because this may cause issues for developers running Laravel inside a folder, having APP_URL set to http://localhost/myapp, paths should be like http://localhost/myapp/style.css but will be /style.css instead. Since the browser will try to fetch them from the website root, it falls back to http://localhost/style.css that does not exist.
Is there a solution for those cases?
Yes! Those extreme cases can disable the relative paths on configs or env.
This aims to fix https://github.com/Laravel-Backpack/CRUD/issues/5127.
It's not the ideal fix, but this will avoid the usage of
APP_URL
byasset()
.Generated paths are now relative;
Side note; @pxpm I'm happy to tell you that this PR also fixes the last double slash issue 😅
Why isn't this the ideal fix?
Is there a solution for those cases?