2 months ago

Web and Api middleware - Use cases

Posted 2 months ago by orest

Jeffrey in his videos puts in the web.php all the routes, even routes from Ajax requests, and then he used to get the authenticated user from sessions using auth()->user()

In case that I want to put the Ajax requests in api.php should I use the api middleware for stateless requests and then token based authentication to access the authenticated user Or I can use the web middleware even in api.php ?

Please sign in or create an account to participate in this conversation.