# Installing Ray for Laravel

[Laravel](https://laravel.com/) is the most popular PHP framework, known for its elegant syntax and powerful features. Use Ray to help you debug when you're developing a Laravel application or package.

[spatie/laravel-ray](https://github.com/spatie/laravel-ray)

## Install in a single project

```
composer require spatie/laravel-ray
```

This installs Ray as a project dependency, meaning it will also be installed in your production environment. Your application won't break if you forget to remove a `ray` call. The package doesn't send data when the environment isn't set to `dev`.

If you prefer, install it as a dev dependency by adding `--dev` to the composer command. Note that with a dev dependency, any `ray` calls left in your code will cause errors in production, so you'll need to remove them before deploying. We have some options for [detecting Ray calls](/content/docs/php/vanilla-php/detecting-removing-ray-calls/index.html) in your app.

```
composer require spatie/laravel-ray --dev
```

## Global installation

To make `ray()`, `dump()` and `dd()` available in any PHP file on your system, you can install the global Ray package. See the [global installation instructions](/content/docs/php/vanilla-php/installation#global-installation/index.html) for setup details.

## Publishing the config file

Optionally, publish [the config file](/content/docs/php/laravel/configuration/index.html) to your project root.

```
php artisan ray:publish-config
```

Add the `--docker` or `--homestead` option to set up a base configuration for those environments.

```
php artisan ray:publish-config --docker
```

```
php artisan ray:publish-config --homestead
```

## Using Ray in an Orchestra test suite

To use Laravel-specific functionality in an Orchestra-powered test suite, register Ray's service provider in your base test case.

```
protected function getPackageProviders($app)
{
    return [\
        \Spatie\LaravelRay\RayServiceProvider::class,\
    ];
}
```

## What's next?

Now that Ray is installed in your Laravel project, explore what else it can do!

- [Learn how to use Ray with Laravel](/content/docs/php/laravel/usage/index.html)
- [View all available methods (PHP)](/content/docs/php/vanilla-php/reference/index.html)
- [Customize your configuration](/content/docs/php/laravel/configuration/index.html)

## Debug without breaking your flow

Ray keeps all your debug output neatly organized in a dedicated desktop app.

Download Ray

[Buy Ray for\ 434 NOK](https://spatie.be/products/ray)

Licenses are valid for 1 year and managed through [Spatie](https://spatie.be/products/ray). Licenses purchased before Ray 3 remain valid. VAT is calculated at checkout.

## Thanks for trying out Ray!

macOS

[ARM](https://spatie.be/products/ray/v3/download/macos-arm64/latest) [Intel](https://spatie.be/products/ray/v3/download/macos-x64/latest)

Windows

[x86 (Intel)](https://spatie.be/products/ray/v3/download/windows/latest)

Linux

[AppImage](https://spatie.be/products/ray/v3/download/linux/latest)

By downloading Ray, you agree to our [terms of use](/content/terms-of-use/index.html).  
The free trial lets you send up to 20 messages per session.
