Lunar Documentation

repository·1.x·Indexed 25 days ago

https://github.com/lunarphp/lunar

An 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.

Tokens
1.2K
Snippets
1
Records
14
Agent score
86%

What's inside Lunar

  1. Overview of Lunar

    1.x
    Lunar 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.
  2. Understand the Lunar Monorepo structure

    1.x

    Lunar 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.
  3. Import address data via lunar:import:address-data

    1.x
    Use the lunar:import:address-data command to import country and state data into your Lunar installation. This command fetches the latest country and state information from http://data.lunarphp.io/countries+states.json and populates the Country and associated State models. It automatically skips countries that already exist in your database based on their iso3 code.
  4. Migrate GetCandy into Lunar

    1.x

    Use the lunar:migrate:getcandy command to migrate data from a GetCandy installation into Lunar.

    This command performs several automated steps:

    1. Table Renaming: Identifies tables prefixed with getcandy_ and migrates their data into corresponding lunar_ tables.
    2. Polymorphic Relationship Updates: Updates polymorphic type columns (e.g., model_type, element_type, taggable_type) by replacing the string 'GetCandy' with 'Lunar'.
    3. Attribute Data Migration: Updates the attribute_data column in products, product_variants, customers, and collections tables to replace 'GetCandy' with 'Lunar'.
    4. Brand Migration: Specifically handles the migration of brand names from getcandy_products into the lunar_brands table and maps the resulting brand_id on products.
    5. Migration Cleanup: Removes old migration records and runs standard migrations.

    Note: Once the migration is finished, you can safely delete the old getcandy_ tables.