Laravel Valet replacing public sites with 404 Not Found - laravel

I'm learning Laravel, and I successfully installed Valet. Did some basic development. Then moved on to other things totally unrelated. About a week later (today) I visited two sites (in Chrome and Safari Mac):
postmarkapp.com
getsatisfaction.com/activeinbox
And I get "Valet - Page Not Found".
I do not get this issue any other website I visit. And I've never seen something selectively take over a site like this. It's obviously related to my local configuration but because I'm new to Valet I have no idea where to start with this.
What is happening?
How is this possible?
How do I resolve this?

What is happening?
Your network configuration is pointing those domains to valet instead of looking them up through external name servers.
How is this possible
Laravel Valet uses dnsmasq so you don't have to worry about editing your /etc/hosts file for each dev site you create. It can step in and provide ip resolution before looking externally for an ip address.
How do I fix this
From a terminal run:
valet domain test
valet restart
My guess is you changed your domain on valet to com and the reason other sites are working is their ip addresses are already cached locally.

In your project directory, you will need the public folder.
To get this, copy the public_html and duplicate it.
Proceed to rename it to public
If it's a new project, create the .env file and run php artisan key:generate
Then valet restart and you'll be good now.

Related

How to share subdomain site using laravel valet?

I'm developing site with subdomain. I am using laravel valet as well So, It's currently look like https://app.portal.test/ in my local environment. I want to share this site using laravel valet sharing site option sharing-sites-via-ngrok. But it's not working. So I guess I want to do something different for sharing with subdomain. Anyone have any idea how to do for valet share for subdomain?
TLDR: You can't
You cant share https://app.portal.test (.test), thats for local only, it doesn't resolve on internet.
If you have public ip (whatsmyip.com) and that ip opens your localhost, then you can create a virtual host that point to that IP but you still need a real domain not test.
Using ngork is best option you have, You can also get a cheap $3 vps and point your domain to it.

OSX unexpectedly forwarding localhost requests to a domain

I'm scratching my head at this:
I've got a fresh laravel app which I'm developing using php artisan serve on 127.0.0.1:8000. The OS is OSX Big Sur. (important for later: docker is not running on my machine.)
There are relative image paths being used in the app, the images do exist in file system.
Some (not all) images are 404ing, because the app is trying to retrieve them from a domain I used to develop on a docker container - this was a separate app and last used months ago.
E.G. a hardcoded relative image path /media/image.jpeg will show in the network log as 404 with the URL being: https://www.example.com/media/image.jpeg Not http://127.0.0.1:8000/media/image.jpeg which would be the expected behaviour.
This happens in both Chrome and Safari, leading me to think it is not
a caching issue, though I have cleared caches in both browsers.
There is no mention of https://www.example.co.uk in /etc/hosts
There is no mention of https://www.example.co.uk in .htaccess
There is no forced SSL in the application. Apache is not being used
to serve the app, but Apache was used in the docker container
which ran https://www.example.co.uk.
Same behaviour when serving app on php artisan serve --host=derp.com in stead of 127.0.0.1
Thanks in advance for any insight!
Damnit.
Somehow, a view file had a meta tag of: <base href="https://www.example.co.uk/" /> and was causing all relative assets to go to that domain, so this wasn't an environmental issue.

Laravel PHP Sessions for IPS Community

I'm trying to install IPS Community(https://invisioncommunity.com/) on a fresh local laravel server. However, when I enter the installation process I get the following error. It might be worth mentioning the server is running on a homestead server too.
The installer uses PHP sessions to store data, however PHP sessions are currently not working correctly on your server. This is an issue you will need to contact your host about.
Does anyone know how to enable PHP sessions?
Anyone having this issue... You need to delete the "Constants.php" in your IPS directory to fix this.

Something is running on 127.0.0.1, can't open laravel's valet website

I'm messing up with django/wordpress/node, etc, and I've used MAMP and other stuff. The problem now is that, I'm trying to use Laravel's Valet. And when I try to access mysite.dev , it opens another website I may have created in the past, which is just an with the "it works!" sentence. I tried rebooting, shutting down mysql, trying other ports...nothing. Help?

Sharing sites quickly like Laravel valet

I would like to be able to share Laravel application hosted on a local Homestead Vagrant VM to users online.
Is there a way I can easily do this like Valet does? I have too many sites and configurations made to switch over to Valet hence I'm look for a retrofit solution with my existing Homestead setup.
You can try using vagrant share
https://www.vagrantup.com/docs/share/

Resources