Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

abhilasha's avatar

How to stop/prevent anyone using my api??

Hi,

i have build basic Laravel crud api using this tut https://www.youtube.com/watch?v=MT-GJQIY3EU

but i have question can my api anyone can use in there app if they find my https api address? if yes then how to stop/prevent that... only my apps can use my api and its data and when some other app try to access it should not allowed to see my data.

0 likes
4 replies
bugsysha's avatar

Or you can use IP to allow access.

1 like
abhilasha's avatar

can you explain little more how to do that? OR lead me to some tuts where i can try that :)

bugsysha's avatar

Sure. If you want you can use a package, but I don't see a point to use a package for such a trivial thing. If you search for "Laravel block IP" or something similar you will be presented with a bunch of tutorials that revolve around the same idea (here1, here2, ...).

In the end, it all depends on if your servers are in the same location. If they are, then just either put them in the same WLAN or use private (non-public) IP addresses to be more secure.

Please or to participate in this conversation.