Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

coolsam726's avatar

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:

image

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.

0 likes
0 replies

Please or to participate in this conversation.