Answer the question
In order to leave comments, you need to log in
How to hide API request URL?
There is a client side on Vue, it accesses the server side on Laravel (they are on different servers). The bottom line is that the user should not see the url on which requests are sent. It was decided to make some additional `api.php` file on the client side, and if the client accesses it, and he already accesses the server, the extra information will be hidden from users.
Question: how to implement that vue would make requests for a separate method of a php class if I do not have separate routes for its methods?
Answer the question
In order to leave comments, you need to log in
What exactly are you hiding by accessing api.php?
What can make the client exactly-also access api.php?
I'm afraid not. All requests are logged in the network tab of any browser. In addition, there is no point in hiding these requests, if someone needs it, he will reproduce it.
There is an option to make a terrible code like
$method = $_REQUEST['method'];
$result = __CLASS__::$method;
return $result;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question