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

kokleng's avatar

Can't render correct routes port with vite, laravel, ziggy and Inertia vue js.

I run "php artisan ziggy:generate" for render all route into ziggy.js file but seems there is no port. but it's work for me if i put in (.env) -> APP_URL = http://localhost:8000 and run php artisan ziggy:generate and it work when i access in the browser with localhost:8000 but if i access with this link -> http://127.0.0.1:8000, i need to change APP_URL in (.env) to http://127.0.0.1:8000 and run php artisan ziggy:generate again.

My question is how about when i deploy to the server? is http://localhost:8000 in (.env) still work? what ip do i need to change it in my (.env) file ? is it my domain name? no need to put it with port? or something else? I use share hosting. Please help me, Thanks in advance !!!

0 likes
0 replies

Please or to participate in this conversation.