I'm working with Laravel (5.6) and React (16.4.1+react-router) on a project, and got into a problem maybe some of you having similar problem, so I wonder we could get some ideas. Recently I have found a solution for refreshing error (404) here: How to use React Router with Laravel? and one of the soulutions solved /app/{anything} problem, too.
Now my problem is with resource files (/css, /js) from /public folder. I tried to do a workaround with the same regex as /app =>
Route::get( '/{path?}', function() {
return view( 'home' );
})->where('path', '^((?!app|api|css|js).)*$');
but it's still not working as expected. As I read, we must put this snippet after all routes we included in our app, because of Laravel's caching mechanism, but it's not working with neither /css, neither /js resource files in /public folder > but works with /api and /app routes, and anything I add before /{path?}.
Is there any solutions for this? What am I doing wrong?
Thanks for any help, LeFizzy.