Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mickey's avatar

Passport Vue only works with 'php artisan serve'

I've made a project using the passport api authentication and used the frontend quickstart with vue.

When using the command

php artisan serve

The vue works just fine, but when I access my application via my ip address everything works except the passport vue. No clients or accesstokens are shown even though they clearly exist and it states something went wrong when i try to create a new client.

when i check app/storage/logs/laravel.log nothing is there.

Why does it work fine on php artisan serve but not via my external ip address?

EDIT: As i needed this to work, i found a temporary solution until i can figure out to fix it properly. I've moved all the public folder files into the application name folder and then moved all the files from the application name folder to the exterior www folder.

This allows access to the frontend without having to write the

"APP-NAME/public"

And the passport Vue components now gets the personal-access-tokens as intended.

I still need help to proper fix this. This is just a temporary quick fix.

0 likes
2 replies
D9705996's avatar

@mickey - can you share the request you are sending from Vue front-end to your back-end and the response you get back to allow us to help.

You can get this information from Chrome by opening Dev Tools CTRL + SHIFT + I or right click inspect. then clicking on the Network tab and reloading your page should show you all of the HTTP requests and responses.

1 like
mickey's avatar

I'm really sorry i didn't respond @D9705996 and i know it's been a long time since i asked the question. I really appreciate your help but a lot of personal problems came up.

I hope you still want to help!

When i try to inspect and reload the page, i get 404 not found on the GET request for personal-access-tokens and scopes. I can see it does not go to the:

"APP-NAME/public/oath/personal-access-token"

but just straight to:

"oath/personal-access-token"

How do i make sure it goes to the public folder?

I've read something about the application vue is only in local and isn't available for external access, but switching to production would add it. I edited env and app.php to have production and reloaded but still the same issue.

Please or to participate in this conversation.