Skip to main content
This guide walks through setting up the Lunar monorepo inside a Laravel application for local development and contribution.
Lunar v2 is built as a monorepo: a single repository containing several Composer packages (core, admin, filament, panel, stripe, paypal, and more) plus the shared test suite that exercises them.

Prerequisites

  • PHP 8.4 or higher
  • A working Laravel application (Laravel 12 or 13)
  • Composer
  • Git
  • Node.js 22+ (only needed for panel frontend work)

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.
Add packages to the .gitignore file so it is not committed to the application’s repository.

2. Clone the repository

Fork the lunarphp/lunar repository on GitHub, then clone the fork into the packages directory on the 2.x branch.
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.
The lunarphp/lunarmono package is the monorepo root and includes the packages needed to run a store out of the box: the core engine and the Filament admin panel (via its lunarphp/filament bridge).
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.
Once complete, follow the standard installation steps to run migrations and publish assets.

Monorepo Structure

The monorepo contains the following packages under packages/: PHP tests for each package live under the top-level tests/ directory, grouped by package name (tests/core, tests/admin, and so on).

Running Tests

Lunar uses Pest for its PHP test suite. Each package has its own Pest testsuite, defined in phpunit.xml, and CI runs them one at a time rather than as a single combined pass. Run tests from the monorepo root at packages/lunar/, matching CI:
The full list of testsuites in the CI matrix is core, admin, panel, filament, shipping, stripe, paypal, search, and upgrade. A demo-data testsuite also exists but is not part of the CI matrix. To run the full local sweep:
Cross-database tests run as a group rather than a testsuite, against MySQL and PostgreSQL:
All existing tests must continue to pass before submitting a pull request.

Panel Frontend

The Inertia + Vue panel (packages/panel) has its own dependency tree, separate from the monorepo’s root npm workspace, and needs its own install.
The example add-on package builds through the npm workspace at the monorepo root instead:

Code Style and Static Analysis

Lunar follows the Laravel coding style and uses Laravel Pint for enforcement, and PHPStan (via Larastan) for static analysis. Run both from the monorepo root before committing changes.

Next Steps

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