Answer the question
In order to leave comments, you need to log in
Laravel Where to use the Route API?
Tell me how is it right?
I have a big database.
I'm doing a project on Laravel, and there are different requests from users.
For example: Search request (for everyone), vote request (for registered users), view request (data by id), and so on.
Now it's all through the WEB router. But I would like to make a client on VUE.js in the future, and Laravel under the API.
And if it will be one whole application, then I do not need the Authentication (Passport) API ?
As I understand it, since I have everything in one application, then I just need to make all requests through the API router and not the WEB will do it?
Answer the question
In order to leave comments, you need to log in
you just need all requests through the router API
difference between api routes and web
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
'throttle:60,1',
'bindings',
],
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question