Answer the question
In order to leave comments, you need to log in
How can I make ajax requests to api from frontend (separate domain) to backend (laravel)?
I just recently started learning Laravel - tell me how to set up interaction between the frontend and backend via api? As far as I understand, ajax requests cannot be made so simply from another domain.
Answer the question
In order to leave comments, you need to log in
Put corses on the lara https://github.com/barryvdh/laravel-cors, in the file routes/api.php write routes to
use axios on the front https://github.com/axios/axios
There are a lot of articles on this topic in the internet
https ://codeburst.io/api-authentication-in-laravel...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question