Home » Php » php – Cannot refresh or move back to previous in angular after deployment

php – Cannot refresh or move back to previous in angular after deployment

Posted by: admin February 23, 2020 Leave a comment

Questions:

I have just integrated my angular 6 project into laravel 5.4.

I followed the normal Laravel templating and here i put my angular index.html code inside welcome.blade.php and it worked fine. I also put the assets in the public folder. I then deployed the entire thing on a shared server.

The problem am having is that after deployment, i cannot refresh or move back to the previous page. I cannot even navigate manually to a url directly in the browser. I need a way to make laravel always load welcome.blade.php everytime i serve a request.

Thank you for any help.

this is my web.php

 <?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

then api.php

    <?php
Route::group([

    'middleware' => 'api'

], function () {

    Route::post('login', '[email protected]');
    Route::post('signup', '[email protected]');
    Route::post('logout', '[email protected]');
    Route::post('refresh', '[email protected]');
    Route::post('me', '[email protected]');

});

That’s where a directing routes from .

And my welcome.blade.php contains the angular index.html code

How to&Answers:

I managed to solve it. The answer is actually here. Thank you very much.