0

I'm new in LARAVEL and nuxtJS, So sorry for my question if it somehow silly. I'm working on a project that developed by anthor one. There is no implementation. The client gave me two folder one for frontend developed by nuxtJS and one for backend developed by laravel.

I tried to run a project. But I fails. Could anyone to help me in that. I installed npm for nuxtJS and composer for laravel.

please ask me for anypart of a code which can help. And I'll post it

Thak you.

1
  • How did you try running the code? Commented Oct 1, 2019 at 13:15

1 Answer 1

1

Assuming Laravel is intended as an API, treat each folder as a separate app. Startup your nuxt application like any other nuxt application. Startup your Laravel application like any other Laravel application. Then using axios or some other fetch library inside your nuxt app, make requests to your Laravel url.

Say you have nuxt running on http://localhost:3000 and you have Laravel running on https://localhost:8000. Inside your nuxt app, where you need to connect to Larvel, you can use axios to get access to your data from Laravel (e.g. axios.get('http://localhost:8000/api/some/resource'))

The docs on asyncData has a good example of making API calls https://nuxtjs.org/guide/async-data

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

Comments

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.