Prerequisites
Setting Up the Monorepo
1. Create a packages directory
In the root of the Laravel application, create apackages directory to hold the monorepo source code.
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 thepackages directory.
packages/lunar/.
3. Configure Composer
Back in the Laravel application’scomposer.json, add a path repository and require the monorepo package.
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.Running Tests
Lunar uses Pest for testing. Tests can be run from the monorepo root atpackages/lunar/.
--filter flag or point to a specific test directory.
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 underpackages/:
| Directory | Composer Package | Description |
|---|---|---|
core | lunarphp/core | Core e-commerce functionality |
admin | lunarphp/lunar | Admin panel built with Filament |
stripe | lunarphp/stripe | Stripe payment driver |
paypal | lunarphp/paypal | PayPal payment driver |
opayo | lunarphp/opayo | Opayo payment driver |
search | lunarphp/search | Search with Typesense and Meilisearch support |
meilisearch | lunarphp/meilisearch | Meilisearch addon |
table-rate-shipping | lunarphp/table-rate-shipping | Table rate shipping addon |
tests/ directory, organized by package name.