yyx990803 / laravel-vue-cli-3

Example project using Vue CLI 3 with Laravel
848 stars 183 forks source link

Routes not working with Nova #8

Open lamalamaMark opened 6 years ago

lamalamaMark commented 6 years ago

When you use the whitelist route in routes/web.php it is not possible to access the API routes created by Nova. These can be excluded by using

Route::get('/{any}', 'SpaController@index')->where('any', '^(?!nova-api).*$');

instead of

Route::get('/{any}', 'SpaController@index')->where('any', '.*');

Added a Pull request: https://github.com/yyx990803/laravel-vue-cli-3/pull/9

bcorcoran commented 6 years ago

Just figured this out myself as well.

I am using

Route::get('/{any}', 'SpaController@index')->where('any', '\#*');

Is there any reason to have anything that doesn't start with "#" routed to the controller?