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

Nyxalis's avatar

Laravel Sanctum for Backend?

Hello Laravel developers!

I wanted to know if there can be any issues in doing the below!! So I am using Laravel Breeze API stack to start of development and the backend will doing all the major work ofcourse such as interacting to an API from a pterodactyl instance. The frontend will be on the same top level domain using NextJS but I also want to include a mobile app using all the API endpoints that I'll be implementing.

It will be an open-src project and I wanted to know if someone could use the API from someone running an instance of my code, since I would't want that to happen.

Hopefully what I said makes sense πŸ˜“

0 likes
4 replies
Thunderson's avatar

yes it is possible you may protect all endpoint with something like sanctum

Nyxalis's avatar

@Thunderson Thank you for the response!!

I want to use CORS with if I use CORS it will be hard to implement a Mobile App, is their a work around?

martinbean's avatar

I want to use CORS with if I use CORS it will be hard to implement a Mobile App, is their a work around?

@Nyxalis Why? CORS only applies in browser contexts (i.e. JavaScript). A native app will not be subject to CORS.

Thunderson's avatar

CORS it not a problem, you will have to use a proxy package in your mobile app to fix it .

Please or to participate in this conversation.