Answer the question
In order to leave comments, you need to log in
How to work with Vue and Laravel without vuerouter?
I usually made SPA applications with a Laravel backend using vue-router.
Is it possible to exclude vue-router from this chain, because there are routers in Laravel?
It is necessary that when you click on each sidebar item on the left, another component is loaded as always and data is pulled from the backend. Using vut-router, everything was clear. but how to implement so that when clicking on the sidebar link, the vue
router is not used, but immediately so that a request is sent to the backend and then the component is loaded into the container with the filled data.
I know how everything works. mounted, dispatch, ... But how to do without a router on the client side?
Answer the question
In order to leave comments, you need to log in
Documentation -
Laravel Component Basics - js
You insert a component into the template and everything works.
Have a look at InertiaJS . By the way, it is used in the JetStream package .
It allows you to make the usual routes in Laravel, while you return InertiaResponse with the data array, and in Vue you get them as props, is this not a miracle.
This is from the InertiaJS description:
...you will use Laravel's router instead of Vue router
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question