0

As I've seen in many tutorials, I used the following code to be able to use the vue-router:

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

Auth::routes();

Route::get('/{any}', function () {
    return view('home');
})->where('any', '.*');

I'm using sanctum and I would like to keep using the Auth::routes() that comes with laravel, but they don't work anymore.

I guess I have to change the {any} pattern with something else, but with what exactly?

Best

Inigo EC
  • 2,178
  • 3
  • 22
  • 31
  • hm I am under the assumption that you should define the more specific routes first, which is what you did. Try `php artisan route:list` and see what it says. – Flame May 24 '20 at 12:43

1 Answers1

1

Ok, so I decided to simply route everything after /app via Vue, the rest will go through laravel.

I went to app->providers->RouteServiceProvider.php and updated the following line as:

public const HOME = '/app/home';

The routing would look like this in Laravel (mention the 'app'):

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

Auth::routes();

Route::get('/app/{any}', function () {
    return view('app');
})->where('any', '.*');

If someone has a better workaround, please let me know!

Inigo EC
  • 2,178
  • 3
  • 22
  • 31