You could just use fetch js to reflect changes, because you said it's working now but with a page refresh.
I guess I don't understand suddenly calling it an API when it's the same data. But there are videos on sanctum that would help you.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have an existing laravel 8 application which does not handle AJAX requests: its views show data that is subject to pretty frequent changes, but the only way to see the most recent data is to refresh the page. I'd want to add some API endpoints to which the frontend will make periodic calls in order to refresh the data. So I've installed Sanctum and I'm trying to use Vue (I'm pretty new to Vue and JS too, tbh).
I understand that the best way to save the token on the frontend is by using an https cookie. What is not clear to me is this: since for now I would like to keep the existing authentication system, how can I make the AuthController to issue a Sanctum token after a successful login, to allow the frontend to save it?
Please or to participate in this conversation.