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

TarikAli's avatar

strict api to only my app

Hello , i want to prevent laravel api to recive any requests exept from my app , so any one send request to my api it will refuse the request and accept requests just from my app , Thanks

0 likes
3 replies
shoemoney's avatar

So many ways to do this... Also not sure of your constrictions..

From high to lowest level...

OS firewall (ip tables, etc). Webserver Firewall - nginx location allow your ips/localhost, deny from all Group route Middleware Firewall - if ip is in array...

I do not have any experience with CORS. That is just how I limit urls.

Please or to participate in this conversation.