Lunar Documentation
repository·1.x·Indexed 25 days ago
https://github.com/lunarphp/lunarAn e-commerce engine for Laravel providing a complete backend suite, including core e-commerce logic and a Filament-based admin panel. Lunar allows developers to build custom storefronts using a monorepo structure consisting of a Core package for models and utilities, and an Admin panel for managing products, orders, and staff.
What's inside Lunar
- Lunar Meilisearch is a package designed to index filterable and sortable attributes using the Meilisearch search engine.
Overview of Lunar
1.xLunar is a set of Laravel packages designed to provide e-commerce functionality (similar to Shopify) within the Laravel ecosystem. It provides a robust backend for managing stores, allowing developers to build custom storefronts while leveraging pre-built e-commerce logic.Understand the Lunar Monorepo structure
1.xLunar is distributed as a monorepo containing several key components:
- Core: The essential package containing all models, actions, and utilities required for store functionality. This package is a prerequisite for the Admin panel.
- Admin panel: A modern management interface built using Filament. It allows for the management of products, orders, staff members, and other store aspects. It is designed to be extensible to meet specific store requirements.
Configure the cart pruning pipeline
1.xThelunar:prune:cartscommand processes carts through a pipeline defined in your configuration. You can add custom logic or filters to the pruning process by adding pipelines to thelunar.cart.prune_tables.pipelinesconfiguration key.Meilisearch setup requirement for lunar:search:index
1.xIf your Laravel Scout configuration is set to use themeilisearchdriver, ensure you have installed and set up thelunarphp/meilisearchpackage. Thelunar:search:indexcommand will issue a warning if thelunar:meilisearch:setupcommand is not available in your application.Reference: lunar:create-admin flags
1.xThe following flags are available for the
lunar:create-admincommand. If omitted, the command will prompt you for the information interactively.--firstname= : The first name of the user --lastname= : The last name of the user --email= : A valid and unique email address --password= : The password for the user (min. 8 characters)Reference: lunar:search:index command options
1.xThelunar:search:indexcommand supports the following arguments and options:Import address data via lunar:import:address-data
1.xUse thelunar:import:address-datacommand to import country and state data into your Lunar installation. This command fetches the latest country and state information fromhttp://data.lunarphp.io/countries+states.jsonand populates theCountryand associatedStatemodels. It automatically skips countries that already exist in your database based on theiriso3code.Discover available addons with lunar:addons:discover
1.xUse thelunar:addons:discovercommand to rebuild the cached addon package manifest. This command scans for available addons and generates a fresh manifest file, which is useful when new addons have been added to the project or when the manifest needs to be refreshed.Migrate GetCandy into Lunar
1.xUse the
lunar:migrate:getcandycommand to migrate data from a GetCandy installation into Lunar.This command performs several automated steps:
- Table Renaming: Identifies tables prefixed with
getcandy_and migrates their data into correspondinglunar_tables. - Polymorphic Relationship Updates: Updates polymorphic type columns (e.g.,
model_type,element_type,taggable_type) by replacing the string'GetCandy'with'Lunar'. - Attribute Data Migration: Updates the
attribute_datacolumn inproducts,product_variants,customers, andcollectionstables to replace'GetCandy'with'Lunar'. - Brand Migration: Specifically handles the migration of
brandnames fromgetcandy_productsinto thelunar_brandstable and maps the resultingbrand_idon products. - Migration Cleanup: Removes old migration records and runs standard migrations.
Note: Once the migration is finished, you can safely delete the old
getcandy_tables.- Table Renaming: Identifies tables prefixed with
Prune old shopping carts via lunar:prune:carts
1.xRun thelunar:prune:cartscommand to clean up thecartstable. This command removes old shopping carts and their associated lines and addresses. It uses a pipeline system that can be extended via configuration.Index model data with lunar:search:index
1.xUse thelunar:search:indexcommand to index model data through Laravel Scout. By default, this command indexes all models defined in yourlunar.search.modelsconfiguration. You can target specific models or use flags to manage how the index is updated.