11

Working on a computer with several old Laravel projects. It looks like they are all parked with Valet.

Valet is not working on new projects, I think because Valet is over extended.

Is there a way to 'mass' un-park and unlink all valet connections or do I have to uninstall and reinstall Valet?

Going through every folder individual and manually un-parking is unrealistic.

seamus
  • 2,681
  • 7
  • 26
  • 49

5 Answers5

24

Laravel Valet has forget command that removes parked directories to valet park list.

cd parked_directory
valet forget
Jim
  • 310
  • 3
  • 7
  • `valet forget` doesn't remove all the parked directories. It just removes the current parked directory. So, why this should be the accepted answer when the question clearly says “unpark all valet registered directories”? – Md Mazedul Islam Khan May 02 '19 at 11:46
  • 2
    The questions says "Does Laravel Valet have a un-park/unlink for **all valet parked projects** on a system?" Valet parked projects, means all projects that are linked to valet. And additional, he asked to the description if "there a way to 'mass' un-park and unlink all valet connections". I don't see it as a _"valet registered directories"_, what he says is "unlink all valet connections". – Jim May 06 '19 at 09:46
9

While Laravel Valet doesn't have a command to forget all the registered working directories, you can manually do it by editing the ~/.valet/config.json file and remove the registered directories from the paths array like the following:

{
    "domain": "dev",
    "paths": [
        "/Users/whoami/.valet/Sites",
        "/Users/whoami/Sites/Test"
    ]
}

Alternatively, you can manually go to each of the registered Valet directories and forget them by running valet forget. However, this would be time-consuming especially when you have bulk registered directories with Valet.

Md Mazedul Islam Khan
  • 5,318
  • 4
  • 40
  • 66
4
valet links

will display all the links of the parked sites

valet unlink SITENAME
Mateen Ray
  • 97
  • 1
  • 4
  • 1
    with this you need to unlink one by one. no ideal with many sites especially if you accidentally parked a whole directory. Peggy's answer is good one https://stackoverflow.com/a/54091249/6714319 – Salam May 12 '20 at 10:45
  • @salam you're assuming an individual doesn't want to unlink just one or two sites out of all. As stated in the documentation the link is for "if you want to serve a single site in a directory and not the entire directory." – FabricioG Jan 28 '21 at 00:46
2

Try cd into the directory that you want to "un-park" and run

valet forget
PassionCorner
  • 81
  • 1
  • 2
1

To unlink the current working directory: valet unlink To unlink a specific project (directory): valet unlink my-project