Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Dashboard fails when project in subdirectory 404s #358

Closed
dhufish opened this issue Apr 18, 2020 · 2 comments · Fixed by #434
Closed

Dashboard fails when project in subdirectory 404s #358

dhufish opened this issue Apr 18, 2020 · 2 comments · Fixed by #434
Labels
good first issue Good for newcomers

Comments

@dhufish
Copy link

dhufish commented Apr 18, 2020

Installing laravel-websockets in a project that resides in the subdirectory of a fqn, the dashboard xhr request paths are incorrectly formed. It can be hacked to work by overriding dashboard.blade.php with static path values... less than ideal.

So when we have an installation like this...
www.example.com/mysite/laravel-websockets

line 121 dashboard.blade.php
authEndpoint: '{{ request()->path() }}/auth',

Produces xhr requests 404

I can overcome this by changing line 121 and 165 of dashboard.blade.php to a static path prefix
line 121 - authEndpoint: '/mysite/{{ request()->path() }}/auth',
line 165 - $.getJSON('/mysite/{{ request()->path() }}/api/'+this.app.id+'/statistics', (data) => {

A dynamic solution is required, passing an install path from websockets.php or changing {{ request()->path() }} to the correct complete path...

I found a post on stack which provides more background...
https://stackoverflow.com/questions/60018500/laravel-websockets-dashboard-base-path-with-sub-folder-not-working

@dhufish
Copy link
Author

dhufish commented Apr 18, 2020

In dashboard.blade.php I replaced request()->path() with Request::getRequestUri() on line 121 and 165, that provides a dynamic solution in Laravel 6.

@erlangparasu
Copy link
Contributor

#434

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants