voyager: Issue - Can't be used in sub-directory (routes & assets)
Hello,
I tried to install this awersome tools in a subdirectory … but I got some issues. Indeed, i found:
- some form action using absolutes paths (impossile to login, for example because there is a
action="/admin/login"). Maybe add names to routes or using action()/route() methods on the blade templates ? - Identical issue with images/css and all assets. I used the asset() function.
ex:
{{ asset(config('voyager.assets_path')) }} - Idem for avatars
<img src="{{ asset($user_avatar) }}" />
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (10 by maintainers)
Thanks @maiorano84 😃 I’ve just merged your PR and will update the latest version within a few hours. I’ll be writing more tests as well to prevent these from happening 😃
Thanks.
Breadcrumbs appear to be pointing fine on my side. Do you mean the links that are generated in the menu itself?
Those come from the built-in seeder. The following commit corrects that issue, but there’s a caveat:
https://github.com/the-control-group/voyager/pull/120/commits/ffa59e7c34deae5c40a391ee20adf25b2d157a2f
In order for those links to be generated with the correct prefix, the config value needs to be set before running the installer. You can test this yourself by creating a fresh installation, setting the
voyager.routes.prefixconfig value, and then running the installation process. The links will be seeded properly then.Otherwise, seeding the database with the wrong prefix will necessitate changing each route in each menu item.
Provided my PR is accepted, I can probably work on making this an interactive part of the installation process (ie: User is presented with a prompt to set the route prefix during the voyager:install process)