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

song2's avatar
Level 1

Help with setting up an api for specific scenario

Hello

I'm trying to create an API for a digital product I made, but I'm getting a serious case of paralysis by analysis.

The API should do the following:

  1. From the client's browser (using JS, it's a theme based product), make a call to my laravel app passing the customer's email & license key

  2. My laravel app checks the email, if it exists, it proceeds to check if the license key is valid. Then a simple "valid" or "invalid" response should be returned back to the client.

Now I don't need help writing the logic above, but I'm stuck on trying to create the API with proper authentication. Because it's run in the clients browser, I'm not sure how to approach this.

From what I gathered, I should login with a user/email (this will visible by anyone?), get a token, then append the token to the api call URL, which returns the valid/invalid status.

I've been reading loads of tutorials but they almost always include a login view. I strictly need to make a request to my server to check if something is valid.

Any help / direction / tutorials would be appreciated.

Thanks!

0 likes
0 replies

Please or to participate in this conversation.