How to preserve angular routes when using laravel?

I am new to Laravel, so take it easy on me 🙂

I have had my Angular 7 application on www.somedomain.com for a year now, but I am at the point of needing a backend framework. The hosting company fully supports Laravel 5.*; therefore, I installed it on the server.

I have made Laravel’s default route to point to Angular’s index.html like so

Route::get('/', function () { 
View::addExtension('html', 'php');
return View::make('index');
});

Now the webpage opens my Angular app successfully, but routes are not the same as they used to.

I manage GUI pages via Angular routes and try to use Laravel routes for Http requests.

My problem is that now www.somedomain.com/about view can be accessed from the Angular app by pressing the navigation button, and in the URL it shows https://ift.tt/2SaanmQ correctly. But when I try to directly access that URL, it shows 500 server error because it is being handled by Laravel.

How can I make sure my GUI routes work without Laravel intervention?

from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/2W4NhiN
via IFTTT

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.