0

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', 'AuthController@login');
    Route::post('signup', 'AuthController@signup');
    Route::post('logout', 'AuthController@logout');
    Route::post('refresh', 'AuthController@refresh');
    Route::post('me', 'AuthController@me');

});

That's where a directing routes from .

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

Logos
  • 1
  • 2
  • You can use `.htaccess` to do that: `Redirect 301 / https://example.com/` More info here: https://help.dreamhost.com/hc/en-us/articles/215747748-How-can-I-redirect-and-rewrite-my-URLs-with-an-htaccess-file- – Jacopo Sciampi Feb 18 '20 at 16:28
  • i did that then the browser returned that i was redirected too many times – Logos Feb 18 '20 at 17:41
  • Ok, can you provide us some relevant code such as the `package.json` and the routing configuration file? Also, can you please add one part of code where you're actually redirecting the application to a route? – Jacopo Sciampi Feb 19 '20 at 07:29

1 Answers1

0

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

Logos
  • 1
  • 2