[Vuejs]-Vue Route does not working. Laravel 8 + Vue

4👍

you need to use this in web.php

Route::any('{all}', [TestController::class, 'test'])
    ->where('all', '^(?!api).*$')
    ->where('all', '^(?!storage).*$');


or

Route::any('{all}',function(){
    return view('main'); // it should be main blade file 
})
->where('all', '^(?!api).*$')
->where('all', '^(?!storage).*$');

to work vue router without #

this code exclude api and storage url so both will work and other all route catch so vuejs do its magic

Leave a comment