### Output of herd init applying configuration Source: https://herd.laravel.com/docs/macos/sites/herd-yaml Example output from running herd init on a project with an existing herd.yml. It shows the sequence of setup steps: installing PHP, securing the site, starting MySQL and Redis, and the final success message. ```bash ~ herd-website (main) › herd init INFO Setting up your project… INFO PHP 8.3 is installed. INFO Site is secured. INFO Mysql is running on port 3346 INFO Installing service Redis INFO Redis is running on port 6379 DONE Your application is ready to go! ``` -------------------------------- ### install_service Source: https://herd.laravel.com/docs/windows/advanced-usage/ai-integrations Install a service on your system. This will download the service’s binary, configure it, and start it. ```APIDOC ## install_service ### Description Install a service on your system. This will download the service’s binary, configure it, and start it. ### Method TOOL ### Endpoint install_service ### Parameters #### Request Body - **type** (string) - Required - The type of service to install. - **port** (number) - Required - The port to use for the service. ### Response Returns the result of the installation. ``` -------------------------------- ### Clone and set up an existing Laravel application Source: https://herd.laravel.com/docs/macos/guides/laravel Clone a repository and follow typical setup steps: copy environment file, install dependencies, generate key, and run migrations. ```bash git clone path-to-your-repository cd repository-name cp .env.example .env composer install herd php artisan key:generate herd php artisan migrate ``` -------------------------------- ### Start a service instance with herd services:start Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Starts a service instance of the specified type. Example: herd services:start mysql ```bash herd services:start mysql ``` -------------------------------- ### herd php:install - Install a PHP version Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Installs a specified PHP version. Example installs PHP 8.3. ```bash herd php:install 8.3 ``` -------------------------------- ### MAMP site path example Source: https://herd.laravel.com/docs/macos/migration-guides/mamp Example of a MAMP site path before migration. ```text /Applications/MAMP/htdocs/mysite ``` -------------------------------- ### herd services:start Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Starts a service instance. ```APIDOC ## herd services:start ### Description Start a service instance. ### Usage ``` herd services:start mysql ``` ``` -------------------------------- ### Example PostgreSQL CLI binary path Source: https://herd.laravel.com/docs/windows/herd-pro-services/postgresql An example path for a specific user and version. Replace 'sebastian' with your username and '16' with your PostgreSQL version. ```text C:\Users\sebastian\.config\herd\bin\services\postgresql\16\bin ``` -------------------------------- ### Example MySQL binary path Source: https://herd.laravel.com/docs/windows/herd-pro-services/mysql Example of the MySQL binary path for a specific user and version. This is used to add the binary to your PATH. ```text C:\Users\sebastian\.config\herd\bin\services\mysql\8.0.36\bin ``` -------------------------------- ### Example MariaDB binary path Source: https://herd.laravel.com/docs/windows/herd-pro-services/mariadb Example of the resolved path to the mariadb binary for a user account. Used to add the binary to PATH. ```text C:\Users\sebastian\.config\herd\bin\services\mariadb\10.11\bin ``` -------------------------------- ### Install MinIO Client (mc) via Homebrew Source: https://herd.laravel.com/docs/macos/herd-pro-services/minio Install the MinIO Client (mc) via Homebrew, required for bucket management since recent MinIO versions removed it from the web dashboard. ```bash brew install minio/stable/mc ``` -------------------------------- ### Verify Herd installation with version commands Source: https://herd.laravel.com/docs Run these commands after installing Herd to verify that the herd, php, laravel, composer, and node binaries are available in your terminal. The onboarding process installs a background service that handles nginx and dnsmasq and requires admin permissions. ```bash herd --version php --version laravel --version composer --version node --version ``` -------------------------------- ### Install SPX profiler extension Source: https://herd.laravel.com/docs/macos/debugging/profiler Downloads and installs the SPX profiler extension, moving it to the Herd application directory and adding it to all existing php.ini files. Run again after installing a new PHP version to add the extension to that version automatically. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/beyondcode/php-spx/HEAD/install.sh)" ``` -------------------------------- ### Example herd.yml with all customizations Source: https://herd.laravel.com/docs/macos/sites/herd-yaml Example herd.yml file using all possible customizations. It sets the project name, PHP version, TLS/SSL security, aliases, and services with versions and ports. Ports can reference .env placeholders like ${REDIS_PORT} or be fixed values. ```yaml name: herd-website php: '8.3' secured: true aliases: - herd-laravel services: mysql: version: 8.0.36 port: '${DB_PORT}' redis: version: 7.0.0 port: '${REDIS_PORT}' ``` -------------------------------- ### Herd site path example Source: https://herd.laravel.com/docs/macos/migration-guides/mamp Example of the new Herd directory path after moving the site. ```text ~/Herd/mysite ``` -------------------------------- ### Create a test mail and start tinker Source: https://herd.laravel.com/docs/macos/guides/laravel Generate a markdown mail class and start a tinker session to test the email configuration. ```bash herd php artisan make:mail TestMail --markdown herd tinker ``` -------------------------------- ### List installed service instances with herd services:list Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Lists all installed service instances and their current status. Available for Herd Pro users. ```bash herd services:list ``` -------------------------------- ### Create HerdHelper service Source: https://herd.laravel.com/docs/windows/troubleshooting/herdhelper Install the HerdHelper service from scratch. The escaped inner quotes are required because the path contains a space; without them, Windows registers the service with an unquoted path and fails to start it. ```plaintext sc.exe create HerdHelper binPath= "\"C:\Program Files\Herd\HerdHelper.exe\"" start= auto ``` -------------------------------- ### Install extension via pecl Source: https://herd.laravel.com/docs/macos/technology/php-extensions Use pecl to install the desired PHP extension after Homebrew PHP is installed. Replace [extension-name] with the actual extension name. ```bash pecl install [extension-name] ``` -------------------------------- ### Install Typesense PHP SDK with Composer Source: https://herd.laravel.com/docs/macos/herd-pro-services/typesense Install the Typesense PHP SDK via Composer, required when using Typesense with Laravel Scout. ```bash composer require typesense/typesense-php ``` -------------------------------- ### Install base PHP via Homebrew Source: https://herd.laravel.com/docs/macos/technology/php-extensions Install a base PHP version via Homebrew to compile extensions. This base PHP is only used for compiling; Herd continues to use its static binaries. ```bash brew install php ``` -------------------------------- ### Create herd.yml Configuration Source: https://herd.laravel.com/docs/macos/migration-guides/sail Example herd.yml configuration file defining project name, PHP version, and MySQL/Redis services. ```yaml name: your-project-name php: '8.3' services: mysql: version: 8.0.36 port: '${DB_PORT}' redis: version: 7.0.0 port: '${REDIS_PORT}' ``` -------------------------------- ### Install Meilisearch PHP SDK via Composer Source: https://herd.laravel.com/docs/macos/herd-pro-services/meilisearch Install the Meilisearch PHP SDK and the HTTP factory package required when using the Meilisearch driver with Laravel Scout. ```bash composer require meilisearch/meilisearch-php http-interop/http-factory-guzzle ``` -------------------------------- ### herd links: Example output table Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Example output of the herd links command, showing a table of linked sites with columns for Site, SSL, URL, Path, PHP Version, and an additional column. The SSL column shows an X when SSL is enabled. ```text +------------------+-----+------------------------------+------------------------------------+-------------+---------+ | Site | SSL | URL | Path | PHP Version | | +------------------+-----+------------------------------+------------------------------------+-------------+---------+ | beyondco.de | | http://beyondco.de.test | /Users/seb/Code/beyondco.de | 8.2 | v21.3.0 | | herd.laravel.com | | http://herd.laravel.com.test | /Users/seb/Code/herd.laravel.com | 8.3 | 21 | | tinkerwell.app | X | https://tinkerwell.app.test | /Users/seb/Code/tinkerwell-site | 8.1 | v21.3.0 | +------------------+-----+------------------------------+------------------------------------+-------------+---------+ ``` -------------------------------- ### herd services:list Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Lists all installed service instances and their current status. ```APIDOC ## herd services:list ### Description List all installed service instances and their current status. ### Usage ``` herd services:list ``` ``` -------------------------------- ### Enable Herd debug logs via command line Source: https://herd.laravel.com/docs/macos/troubleshooting/common-issues Starts Herd with the --enable-logfile argument to write a Herd_Debug.log file to ~/Library/Application Support/Herd/Log. ```bash open /Applications/Herd.app --args --enable-logfile ``` -------------------------------- ### Initialize herd.yml with herd init Source: https://herd.laravel.com/docs/macos/sites/herd-yaml Run in the project directory to start the interactive wizard that creates or updates the herd.yml file. If the file already exists, it configures the site accordingly; re-running applies additional configurations without removing existing ones. ```bash herd init ``` -------------------------------- ### get_all_php_versions Source: https://herd.laravel.com/docs/windows/advanced-usage/ai-integrations Get a list of all PHP versions and their status (installed, in-use, etc.) from Herd. ```APIDOC ## get_all_php_versions ### Description Get a list of all PHP versions and their status (installed, in-use, etc.) from Herd. ### Method TOOL ### Endpoint get_all_php_versions ### Parameters None documented. ### Response Returns a list of PHP versions and their status. ``` -------------------------------- ### WordPress wp-config.php database configuration Source: https://herd.laravel.com/docs/windows/migration-guides/xampp Example wp-config.php database settings for WordPress. Update the host, database name, user, and password to match your setup. ```php define('DB_HOST', '127.0.0.1:3307'); // Use your configured port define('DB_NAME', 'your_database'); define('DB_USER', 'root'); define('DB_PASSWORD', ''); ``` -------------------------------- ### Laravel .env database configuration Source: https://herd.laravel.com/docs/windows/migration-guides/xampp Example .env configuration for Laravel to connect to MySQL. Update the port, database name, username, and password to match your setup. ```env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3307 # Use your configured port DB_DATABASE=your_database DB_USERNAME=root DB_PASSWORD= ``` -------------------------------- ### Open the application in the browser Source: https://herd.laravel.com/docs/macos/guides/laravel Use the 'herd open' command to open the application's .test domain in your browser. ```bash herd open ``` -------------------------------- ### php.ini Xdebug configuration for PHP 8.3 Apple Silicon Source: https://herd.laravel.com/docs/macos/debugging/xdebug Example php.ini configuration for enabling Xdebug in Herd with PHP 8.3 on Apple Silicon. Sets the Zend extension path, debug and develop modes, and starts Xdebug with every request and on errors. ```ini zend_extension=/Applications/Herd.app/Contents/Resources/xdebug/xdebug-83-arm64.so xdebug.mode=debug,develop xdebug.start_with_request=yes xdebug.start_upon_error=yes ``` -------------------------------- ### Get or set Herd loopback address Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Get or set the loopback address used for Herd sites. ```bash herd loopback herd loopback 127.0.0.1 ``` -------------------------------- ### Common MinIO Client commands Source: https://herd.laravel.com/docs/macos/herd-pro-services/minio Common MinIO Client commands for bucket and file management, including creating a bucket, listing buckets, listing files, and uploading a file. ```bash mc mb herd/my-bucket # Create a bucket mc ls herd # List all buckets mc ls herd/my-bucket # List files in a bucket mc cp file.txt herd/my-bucket/ # Upload a file ``` -------------------------------- ### Start HerdHelper service Source: https://herd.laravel.com/docs/windows/troubleshooting/herdhelper Start the HerdHelper service if it is stopped. Run via an elevated PowerShell or Command Prompt. ```plaintext sc.exe start HerdHelper ``` -------------------------------- ### Run herd init --fresh wizard Source: https://herd.laravel.com/docs/macos/sites/herd-yaml Shows the interactive wizard output when running herd init --fresh. Use --fresh to overwrite an existing herd.yml file. The wizard lets you configure project name, aliases, PHP version, TLS/SSL certificates, and (for Herd Pro) services; the space bar selects options. ```bash ~ herd-website (main) › herd init --fresh ┌ What is the name of your project? ───────────────────────────┐ │ herd-website │ └──────────────────────────────────────────────────────────────┘ ... ┌ Do you want to add additional services? ─────────────────────┐ │ › ◻ Meilisearch (1.6.2) ┃ │ │ ◻ MinIO (RELEASE.2024-03-05) │ │ │ ◼ MySQL (8.0.36) │ │ │ ◻ PostgreSQL (16) │ │ │ ◼ Redis (7.0.0) │ │ └────────────────────────────────────────────────── 2 selected ┘ Use the space bar to select options. ``` -------------------------------- ### Set up MinIO Client alias for Herd Source: https://herd.laravel.com/docs/macos/herd-pro-services/minio Set up an alias pointing to your Herd MinIO service. Replace 'minio' in the URL with your service name and adjust credentials if changed. ```bash mc alias set herd https://minio.herd.test herd secretkey ``` -------------------------------- ### Connect to MariaDB via CLI Source: https://herd.laravel.com/docs/macos/herd-pro-services/mariadb Connect to the MariaDB server via the command line. Specify the port to target the correct instance when multiple servers are running. ```bash mariadb -u root -h 127.0.0.1 -P 3306 -p ``` -------------------------------- ### List available versions for a service type with herd services:versions Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Lists all available versions for a specified service type. Example: herd services:versions mysql ```bash herd services:versions mysql ``` -------------------------------- ### Create a new service instance with herd services:create Source: https://herd.laravel.com/docs/macos/advanced-usage/herd-cli Creates a new service instance of the specified type. Example: herd services:create mysql ```bash herd services:create mysql ``` -------------------------------- ### find_available_services Source: https://herd.laravel.com/docs/windows/advanced-usage/ai-integrations Get a list of available services (such as MySQL, Typesense, Redis, Laravel Reverb, Typesense, etc.) on your system. This will also return the environment variables needed for each service to connect and configure it. ```APIDOC ## find_available_services ### Description Get a list of available services (such as MySQL, Typesense, Redis, Laravel Reverb, Typesense, etc.) on your system. This will also return the environment variables needed for each service to connect and configure it. ### Method TOOL ### Endpoint find_available_services ### Parameters None documented. ### Response Returns a list of available services and their environment variables. ``` -------------------------------- ### Xdebug configuration for php.ini Source: https://herd.laravel.com/docs/windows/debugging/xdebug Configuration lines to append to php.ini to enable Xdebug for PHP 8.3. Sets the extension path and enables debug/develop modes, start with request, and start upon error. ```ini zend_extension=C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\xdebug\xdebug-8.3.dll xdebug.mode=debug,develop xdebug.start_with_request=yes xdebug.start_upon_error=yes ``` -------------------------------- ### Create a new Laravel site with Herd CLI Source: https://herd.laravel.com/docs/macos/getting-started/sites Creates a new Laravel application in the Herd directory, opens it in the browser, and opens the project in your favorite IDE. ```bash cd ~/Herd laravel new my-new-site cd my-new-site herd open herd edit ``` -------------------------------- ### Example netstat output for port 80 Source: https://herd.laravel.com/docs/windows/troubleshooting/nginx Example output from the netstat commands showing processes listening on port 80. The last number is the PID, which can be used to identify the application in Task Manager. ```text TCP 127.0.0.1:80 0.0.0.0:0 LISTENING 9920 TCP 127.0.0.1:80 0.0.0.0:0 LISTENING 8752 TCP 127.0.0.1:80 0.0.0.0:0 LISTENING 10064 TCP 127.0.0.1:80 0.0.0.0:0 LISTENING 10228 ``` -------------------------------- ### Create a new Laravel application Source: https://herd.laravel.com/docs/macos/guides/laravel Run these commands in the terminal to create a new Laravel application and switch into its directory. ```bash laravel new my-first-application cd my-first-application ``` -------------------------------- ### Start tinker session with Herd CLI Source: https://herd.laravel.com/docs/macos/guides/laravel Run the tinker command via Herd's CLI to start an interactive PHP session. It proxies Laravel's tinker but uses the application's PHP. ```bash herd tinker ``` -------------------------------- ### Share a site with herd share Source: https://herd.laravel.com/docs/macos/sites/sharing-sites Share a site by running `herd share` in the site directory. Includes examples for sharing a linked site and a secured site. ```bash cd ~/Herd/example-site herd share # Share a linked site: herd share http://your-local-site.test # You can share a secured site with: herd share https://your-secured-local-site.test ```