0

How to use Laravel - Inertia - ReactJS but using routing from ReactJS? The project is made into one folder, but uses the Restfull API concept. Basically I'm Back-End, so I've learn to be full stack dev.

I have tried using ReactJS Router but to no avail.

1 Answer 1

0

inertiajs lets laravel handle routing, so what I suggest is to get your index page using Inertia::render() and then make the rest of the calls using Axios.

Sign up to request clarification or add additional context in comments.

2 Comments

Then, how about storing the csrf token during the authentication process? Does it have to use the API?
sorry for the late replay, to handle authentication I assume you are going to use Laravel Breeze, with interejs it gets Handel automatically you don't have to worry about it, in your laravel code you get access to the auth variable and Middleware, and in you vue/react file you also get access to auth, this auth is updated with every request and can be found and changes in HandleInertiaRequests.php file also known as Shared data. i suggest you take a look at this link as they did explain it better than me link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.