Skip to main content

Per-Site Services

Herd Pro lets you choose which services a Laravel application uses right from the Applications window. Instead of looking up hosts, ports and credentials and editing your .env file by hand, you select a service from a dropdown and Herd updates the configuration for you.

Switching services

Select a site in the Applications window. The “Services” section of the inspector shows one dropdown for each of these categories: Each dropdown lists the built-in Laravel options, the matching services that you already installed and services that you can install. When you select a service that isn’t installed yet, Herd installs and starts it, and applies it to your application afterwards.
Selecting the database of a site
When you switch to MySQL, MariaDB or PostgreSQL, Herd asks which database the application should use. You can pick an existing database or create a new one. To use a different database on the same server later, click “Change…” below the database name.
Per-site services are available for Laravel applications. For other applications, use the services settings and configure the connection yourself.

What Herd changes in your .env file

Herd detects the current configuration from your .env file and only changes the keys of the category that you switch: Herd keeps your DB_DATABASE value when you switch database servers, unless you select or create a different database. When you switch to SQLite, Herd sets DB_DATABASE to database/database.sqlite and creates the file if it doesn’t exist. Before Herd changes a category for the first time, it saves the original values to a .env.herd-services.bak file next to your .env file. Select “Not managed by Herd” in the dropdown to restore these values.

Via the CLI

You can view and change the services of a site with the herd site:services command. Without arguments, it lists all categories with their current value and all options.
You can pass a built-in option like sqlite, sync, database, array, file, log or null, or the name, type or ID of an installed service.