What sort of things are you talking about?
A complete Angular SPA with a Laravel backend API?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all, I searched everywhere about hosting both apps and there are several recommendations.
Hosting both as different apps.
Including Angular dist folder items in Laravel public folder with some settings.
What is the easiest and the best way to host both apps, without interfering the routes?
I have a complete react spa that is running on laravel
My web.php has this single route which just serve a single index.blade.php file
Route::view('/{path?}', 'index')
->where('path', '.*')
->name('react');
And then I have made a separate ajax.php route file for all my react routes, setup kinda like an API, except it uses the web middleware group, to allow sessions, auth etc.
protected function mapAjaxRoutes()
{
Route::prefix('ajax')
->middleware('web')
->namespace($this->namespace . '\Ajax')
->group(base_path('routes/ajax.php'));
}
For never projects I use inertiajs to make this whole think much much easier though :)
Please or to participate in this conversation.