Sep 11, 2020
0
Level 1
Laravel Route matching for projects in a sub-directory
I have come across a difficulty when trying to use Livewire on a project hosted on a sub-path (non-root domain). After debugging I realized the issue boils down to Laravel Wrongly resolving routes based on requests (using route match function) for projects in non-root domains. Has anyone been able to solve or get around this?
Consider the following scenario:
Route::middleware(['auth:sanctum'])->get("/articles", \App\Http\Livewire\ArticlesIndex::class)->name('article.index');
Let's tinker around:

larajet is my apache alias that points to the project's public root
If I use $url = "/articles" and run the route match function, it successfully finds the route.
Any ideas will be much appreciated.
Please or to participate in this conversation.