roozmehr knight
roozmehr knight

Reputation: 107

how to make laravel 9 api-only?

Is there a way to make laravel api-only?(for optimized speed) I wanted to use lumen but it's not listed in the laravel docs anymore. Is there anyway to achive this?

Upvotes: 2

Views: 9709

Answers (2)

Manuel Diera
Manuel Diera

Reputation: 1

For anyone still looking for an answer. I did this recently by only using the API routes and securing them with the Auth0 sdk. My frontend is in Vue and the SPA retrieves access tokens from Auth0, then calls my Laravel API and passes the token on each request.

Upvotes: 0

Bismark Asiedu Asante
Bismark Asiedu Asante

Reputation: 140

Well as indicated by @D1__1, there exist Lumen 9. If you still considers the option of using laravel 9, then I will suggest doing the following:

  1. Using the api routes only
  2. Implementing JWT https://laravel-jwt-auth.readthedocs.io/en/latest/laravel-installation/
  3. [Optional] Change the exception handler to output errors as not expose details of your applications.

Upvotes: 1

Related Questions