S
S
SM_ST2021-06-15 12:47:32
Laravel
SM_ST, 2021-06-15 12:47:32

Why is it giving 404 when routing Vue + laravel?

there is a router in laravel

Route::get('/{any?}', function () {
    return view('admin.index');
});


router in vue

{
    path: '/faq',
    component: () => import('../Pages/Faq.vue'),
    name: '/admin/faq',
  },
  {
    path: '/admin/faq/create',
    component: () => import('../Pages/Forms/Faq/Create.vue'),
    name: 'faq-create',
  },
  {
    path: '/admin/faq/edit',
    component: () => import('../Pages/Forms/Faq/Create.vue'),
    name: 'faq-edit',
  },


at this address http://site.test:8000/ad/faq, when refreshing the page, everything is OK, but with this it http://site.test:8000/ad/faq/creategives 404

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kudrya, 2021-06-15
@SM_ST

Try this

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question