I have searched everywhere for an answer but nothing have worked so far. All the listed solutions on stack have not proven to be sufficient.
I get nothing in my lar
what i have done but not sure if that is the best solution but there are no cors with that one
1.build the angular normally using ng build --prod
2.move the content of angular/dist to laravel/public
3.then use this simple code in laravel/routes/web.php
Route::prefix('api')->group(function () {
Route::get('/', function () {
return view('welcome');
});
});
Route::get('/{params?}', function () {
// return view('welcome');
include_once '../public/index.html';
})->where('params', '(.*)');
now all requests comes to Laravel and if it can catch the request with a route this route will work otherwise it will pass it to angular