A
A
Alexander Osipov2018-03-25 13:33:50
API
Alexander Osipov, 2018-03-25 13:33:50

How to make a private API on Laravel?

Hello. Now I'm doing a full back on Laravel 5.5, I'm studying the passport docks, but the advice of an experienced person in this matter is extremely important.
Passport, as I understand it, provides the opportunity to develop an open API, a lot has been written about this in the docs. But what if I need an API that needs to be closed "from the outside"? Those. it will be used on the website (SPA, Vue.js) and mobile app. What exactly do I need to watch, what should be the sequence of requests?
As I understand it, I need this: https://laravel.com/docs/5.5/passport#consuming-yo...
But it's not clear why we add middleware CreateFreshApiToken to the web group? And how does this change the behavior of the API, what to do next?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ernest Faizullin, 2018-03-25
@erniesto77

It is necessary to add middleware in all API controllers
https://laravel.com/docs/5.5/middleware
https://laracasts.com/discuss/channels/laravel/whe...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question