Does Laravel Valet have a un-park/unlink for all valet parked projects on a system?
Asked Answered
T

5

12

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.

Teets answered 10/4, 2018 at 14:15 Comment(0)
S
11

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.

Scarlet answered 27/4, 2018 at 5:56 Comment(2)
it became ~/.config/valet/Connote
C:\Users\ [username] \.config\valet for Windows usersChristiniachristis
B
26

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

cd parked_directory
valet forget
Bosco answered 8/1, 2019 at 11:51 Comment(2)
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”?Scarlet
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".Bosco
S
11

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.

Scarlet answered 27/4, 2018 at 5:56 Comment(2)
it became ~/.config/valet/Connote
C:\Users\ [username] \.config\valet for Windows usersChristiniachristis
V
6
valet links

will display all the links of the parked sites

valet unlink SITENAME
Visor answered 3/2, 2020 at 19:27 Comment(2)
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://mcmap.net/q/889444/-does-laravel-valet-have-a-un-park-unlink-for-all-valet-parked-projects-on-a-systemObryant
@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."Pasticcio
A
2

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

valet forget
Ashtray answered 16/6, 2022 at 4:44 Comment(0)
A
1

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

Alceste answered 20/5, 2021 at 17:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.