Simqer
Simqer

Reputation: 1

Local url [app_url] not working in Laravel Breeze Vue

So I tried creating a new project using Breeze+vue in Laravel. I was following this guide: https://www.youtube.com/watch?v=A7UlfXPhsaA

When I finally got vite running on npm run dev without issues, I came across the app_url and I tried to change it to something similar like in that guide (timestamp 6:14 in video), in my case the app_url value was just http://localhost and I changed it to http://grandia.test. And it reflects like that when vite is running:

  VITE v3.1.0  ready in 1031 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose

  LARAVEL v9.28.0  plugin v0.6.0

  ➜  APP_URL: http://grandia.test

but nothing happens when I go to the site. only the localhost:5173 works properly.

I tried googling for answers but I couldn't find anything helpful.

Could someone help me out what I'm doing wrong or missing? Thanks!

Upvotes: 0

Views: 945

Answers (2)

Nicolapps
Nicolapps

Reputation: 988

Changing Laravel’s APP_URL parameter will not magically allow you to choose the URL your website is served at. It will only tell Laravel what it should use when generating URLs related to your website.

The video’s author uses the Laravel Valet local development environment. It provides a park command that allows you to automatically serve the subfolders of some folder (e.g. Sites in the video) at http://<subfolder>.test.

In the video, the project is created in Sites/reddit-clone/, which makes it possible to directly access it at reddit-clone.test.

Upvotes: 0

leanghy
leanghy

Reputation: 50

I had the same issue, It look like you changed URL: http://grandia.test instead of localhost. So you should try with npm run build instead.

Upvotes: 0

Related Questions