Skip to main content
This guide walks through setting up the Lunar monorepo inside a Laravel application for local development and contribution.

Prerequisites

Setting Up the Monorepo

1. Create a packages directory

In the root of the Laravel application, create a packages directory to hold the monorepo source code.
mkdir packages
Add packages to the .gitignore file so it is not committed to the application’s repository.
/packages

2. Clone the repository

Fork the lunarphp/lunar repository on GitHub, then clone the fork into the packages directory.
cd packages
git clone https://github.com/YOUR-USERNAME/lunar.git
This places the monorepo at packages/lunar/.

3. Configure Composer

Back in the Laravel application’s composer.json, add a path repository and require the monorepo package.
{
    "repositories": [
        {
            "type": "path",
            "url": "packages/*",
            "symlink": true
        }
    ],
    "minimum-stability": "dev",
    "require": {
        "lunarphp/lunarmono": "*"
    }
}
The lunarphp/lunarmono package is the monorepo root and includes all Lunar packages: core, admin panel, payment drivers, and add-ons.
The symlink option ensures that changes made in the packages/lunar directory are immediately reflected in the application without needing to run composer update after every edit.

4. Install dependencies

Run Composer from the Laravel application’s root directory to install the local packages.
composer update
Once complete, follow the standard installation steps to run migrations and publish assets.

Running Tests

Lunar uses Pest for testing. Tests can be run from the monorepo root at packages/lunar/.
cd packages/lunar
vendor/bin/pest
To run tests for a specific package, use the --filter flag or point to a specific test directory.
vendor/bin/pest tests/core
vendor/bin/pest tests/admin
All existing tests must continue to pass before submitting a pull request.

Code Style

Lunar follows the Laravel coding style and uses Laravel Pint for enforcement. Run Pint from the monorepo root before committing changes.
vendor/bin/pint

Monorepo Structure

The monorepo contains the following packages under packages/:
DirectoryComposer PackageDescription
corelunarphp/coreCore e-commerce functionality
adminlunarphp/lunarAdmin panel built with Filament
stripelunarphp/stripeStripe payment driver
paypallunarphp/paypalPayPal payment driver
opayolunarphp/opayoOpayo payment driver
searchlunarphp/searchSearch with Typesense and Meilisearch support
meilisearchlunarphp/meilisearchMeilisearch addon
table-rate-shippinglunarphp/table-rate-shippingTable rate shipping addon
Tests for each package are located in the top-level tests/ directory, organized by package name.

Next Steps

With local development set up, see the Contributing guide for information on coding standards, submitting pull requests, and reporting bugs.