-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Subfolders not included in menu links #3993
Comments
Laravel shouldn't be installed under public_html for security reasons. A search for "laravel in shared hosting" should provide reasoning and solutions. Having said that, your APP_URL is likely set wrong. Voyager uses named routes for the default menu items, so it's more likely a misconfiguration in your app than a problem in Voyager. |
Hi, Thanks for pointing out that this is insecure. As I stated above I don't do this in production. From my experiments APP_URL in .env seems to be correct and doesn't seem to change URLs in any way except for assets (for example images are broken when it's incorrect). Under a clean install environment (necessary changes only to .env file) Voyager 1.1.12 works and 1.2.1 doesn't so I don't know how this can be a configuration issue (in that case I think Voyager 1.1.12 wouldn't work either - except if I'm missing something). If it's not Voyager it may be a dependency. Unfortunately at the moment I'm still too new to Laravel to debug this. For the time being I'll get around this using a subdomain. However, I do think there's a problem somewhere. If you are certain that this is a config issue feel free to close this issue. Thanks. |
Having the same issue. I'm temporarily making the urls static and changing them all manually. |
The problem is that the menu-item urls are resolved relative, not absolute. |
@emptynick Good catch! |
Should it be implemented next version ?! Ty @emptynick :) |
I think so, yes |
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. |
Version information
Description
The admin menu has incorrect links when Voyager is accessed in a subdirectory. Routes are correct as they work as expected, so we have correct app urls but incorrect menu links. Note: this procedure is to demonstrate the problem and does not create a secure laravel installation.
Steps To Reproduce
composer create-project --prefer-dist laravel/laravel mylaravelapp
cd mylaravelapp
composer require tcg/voyager
-- set database options --
php artisan voyager:install
php artisan voyager:admin mail@mail.com --create
Links are pointing to http://localhost/admin/* which is wrong. URLs are accessible using http://localhost/mylaravelapp/public/admin/* which is correct.
Expected behavior
Menu's links should be pointing to http://localhost/mylaravelapp/public/admin/* addresses. This works as expected with Laravel 5.7.28 and Voyager 1.1.12.
The text was updated successfully, but these errors were encountered: