I can't seem to get this working. I want to use Laravel as an API back-end and let vue-router handle the routing. Can someone share an example of vue-router replacing the Laravel's router role?
Right now, I'm using this sort of hack, where I return the blade file where I load vuejs:
@JohnRivs Not sure how much this will help you, but @mattstauffer released an open source project within the last few days that may give you a good starting point.
The most straight forward way is to create a catch all route and point it to a view.
Route::get('/{catchall?}', function () {
return response()->view('index');
})->where('catchall', '(.*)');
You need this (or manually add all your "vue" routes) because at some point someone might refresh their page and laravel would not know what to do with it. Also make sure your API and other "laravel" routes are loaded first.