If I understood your questions correctly, I think something like Laravel Sanctum can help
https://laracasts.com/series/whats-new-in-laravel-7/episodes/6
Your client(Vue SPA), however, should be in the same domain as the server for this to work.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Let's say I have two different servers:
I'm just not sure, how can I secure this connection between those two servers, so that foreign request from other servers are not able to do anything?
For example, I have a simple form on the SPA and I want to send it to the API server so that it can send me an email back to me. Nothing special. Now it's easy to find out what the endpoint is. I want to prevent others to send a request via the endpoint. How do you do it?
I have looked up for solutions. But usually, I have ended up with Laravel Passport. But that's not really what I'm looking for. I don't need OAuth. I don't have users on the SPA.
Thank you for your help!
If I understood your questions correctly, I think something like Laravel Sanctum can help
https://laracasts.com/series/whats-new-in-laravel-7/episodes/6
Your client(Vue SPA), however, should be in the same domain as the server for this to work.
Please or to participate in this conversation.