0

I am implementing a laravel web application and I separately implementing a native mobile application as well. I need to use the same backend which I use for a web application for mobile application as well. How can I implement the backend as a REST API which can be called from a mobile application and also use for the web application as well?

1
  • it's simple! just make your API's and then call them with both Vue (for web) and flutter(for mobile). you dont need to specify them for seprate usage! Commented Apr 24, 2021 at 5:33

1 Answer 1

2

there's a file located in routes/api.php. You can store your API there like the way you implement your routes at web.php. But return JSON from your controller for your REST API.

you can call it like http://yourdomain/api/yourroute

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

2 Comments

do you have any example or tutorial, can you share the link of that please.
daily-dev-tips.com/posts/laravel-basic-api-routes @lordyhas this maybe the most basic i can found on internet. hope it helps

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.