Laravel Valet - Rocketeers

  [ Rocketeers ](/)   

[Login](https://rocketeersapp.com) 

 On this page

 Knowledge
---------

Laravel Valet
=============

### [\#Laravel](https://rocketee.rs/index.php/laravel)

For Mac users Laravel Valet is an execellent tool to develop all your PHP projects locally.

 Published by [Mark van Eijk](https://rocketee.rs/index.php/author/mark-van-eijk) on April 26, 2023 · 2 minute read

1. [What is Laravel Valet?](#content-what-is-laravel-valet)
2. [Not only for Laravel apps](#content-not-only-for-laravel-apps)
3. [How to install Laravel Valet](#content-how-to-install-laravel-valet)
4. [How does it work](#content-how-does-it-work)
5. [Using different PHP versions](#content-using-different-php-versions)

[\#](#content-what-is-laravel-valet "Permalink")What is Laravel Valet?
----------------------------------------------------------------------

Laravel Valet is a tool that makes developing locally more enjoyable, because it makes your Mac instantly ready for development on your local computer. It's a minimalist tool, that uses Homebrew to install everything you need and get started quickly.

Laravel Valet uses nginx, DnsMasq and PHP binaries to make it easy to develop using PHP and being able to switch to different PHP versions.

[\#](#content-not-only-for-laravel-apps "Permalink")Not only for Laravel apps
-----------------------------------------------------------------------------

Despite its name, Laravel Valet is not only for developing Laravel apps. Valet supports out of the box the following types of projects to run locally on your computer.

- Laravel
- Bedrock
- CakePHP 3
- ConcreteCMS
- Contao
- Craft
- Drupal
- ExpressionEngine
- Jigsaw
- Joomla
- Katana
- Kirby
- Magento
- OctoberCMS
- Sculpin
- Slim
- Statamic
- Static HTML
- Symfony
- WordPress
- Zend

[\#](#content-how-to-install-laravel-valet "Permalink")How to install Laravel Valet
-----------------------------------------------------------------------------------

First ensure Homebrew is up to date with the latest software packages:

 ```
brew update

```

Then, install PHP using:

 ```
brew install php

```

Make sure that `~/.composer/vendor/bin` is in your system's PATH, so that after composer is installed, you can install Laravel Valet as a global package:

 ```
composer global require laravel/valet

```

At last, install Valet using the `install` command:

 ```
valet install

```

After that, you can use any \*.test domain to use locally on your projects.

[\#](#content-how-does-it-work "Permalink")How does it work
-----------------------------------------------------------

Laravel Valet uses a simple paradigm: every domain is a folder inside "parked" directory. So when you want to use the Mac folder `~/Sites` to clone all your projects on your computer in, you can `park` inside this directory to make all folders available as a `[folder].test` domain.

 ```
cd ~/Sites

valet park

```

[\#](#content-using-different-php-versions "Permalink")Using different PHP versions
-----------------------------------------------------------------------------------

Install different PHP versions you need for you local repositories, you can install additional PHP version using:

 ```
brew install php@8.3

```

Replace the version number with the version you want to install. After that you can tell Laravel Valet to use this PHP version for your project or as a new default PHP version for all sites.

To use PHP 8.3 for all sites:

 ```
valet use php@8.3 # use --force when this is not enough

```

Or only for a specific site:

 ```
valet isolate php@8.3 # execute this inside the correct ~/Sites/[site] folder

```

You can also set a specific version for Laravel Valet to use, when using the `valet use` (without a PHP version) command. The PHP version can be determined from a `.valetrc` file in the root of the project:

 ```
php=php@8.3

```

After adding this file, you can execute `valet use` to always use the specified PHP version with Laravel Valet.

### Subscribe to our newsletter

Do you want to receive regular updates with fresh and exclusive content to learn more about web development, hosting, security and performance? Subscribe now!

  Fill in your email address to receive updates  Subscribe 

#### More in [\#Laravel](https://rocketee.rs/index.php/laravel)

- [How to use different PHP versions with Laravel Valet](https://rocketee.rs/index.php/different-php-versions-laravel-valet)
- [Disable cookies in Laravel](https://rocketee.rs/index.php/disable-cookies-in-laravel)
- [Logging in Laravel](https://rocketee.rs/index.php/laravel-logging)
- [How to check which Laravel version of your app is using](https://rocketee.rs/index.php/check-laravel-version)
- [Disable CSRF in Laravel](https://rocketee.rs/index.php/disable-csrf-in-laravel)
- [Creating an encrypted cookie value in Laravel](https://rocketee.rs/index.php/creating-an-encrypted-cookie-value-in-laravel)

 [View all 19 articles →](https://rocketee.rs/index.php/laravel)
