[Vuejs]-Inertia redirect issue in Laravel with Vue

1👍

Don’t use (it’s only for External redirects):

Inertia::location()

use:

to_route('pdf-chat', ['chat' => $chat->hash, 'pdf' => $pdf->hash])

0👍

Instead of using Axios to make the request, use Inertia’s router.visit or one of their helpers like router.get. These will intercept the request and know how to handle the response.

See https://inertiajs.com/manual-visits

router.visit('/pdf-chat/create-chat', {
  method: 'get',
  data: {
    name: name.value,
    pdfId: id
  }
})

Leave a comment