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

achourphp's avatar

How to secure my laravel API?

I recentelly created a backend API with laravel and i connected to my frontend with react js, i want to secure my api to only be accesed when the client is my front end, is this possible ?

0 likes
4 replies
KalimeroMK's avatar

just add auth prefix to the route and use token if you are using sanctum use auth:sanctum middleware

1 like

Please or to participate in this conversation.