Good day to all! When 'untying' from web.php as follows:
Route::get('/{page}', IndexController::class)->where('page', '.*');
the router looks like this:
import Vue from 'vue'
import VueRouter from "vue-router";
Vue.use(VueRouter)
export default new VueRouter({
mode: "history",
routes: [
{
path: '/parts', component: () => import('./components/Part/PartIndex'),
name: 'part.index'
}
]
})
The IndexController is triggered and goes to the main page. Next, the idea begins to work api.php .
Route::prefix('parts')->group(function () {
Route::get('/', PartIndexController::class);
});
However, when the axios.get('/api/parts/') method is called from the component, the IndexController is triggered again and returns the home page instead of the actions that PartIndexController should have performed.
If you remove the web in the first route.php ->where('page', '.*'); Part IndexController is triggered, but does not work correctly (outputs 404 on reboot).
I ask for help.