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.
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.
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 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.
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/.
To run tests for a specific package, use the --filter flag or point to a specific test directory.
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.

Monorepo Structure

The monorepo contains the following packages under packages/: 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.