{"id":37232564,"url":"https://github.com/blax-software/laravel-shop","last_synced_at":"2026-01-15T03:49:45.696Z","repository":{"id":325446562,"uuid":"1101208676","full_name":"blax-software/laravel-shop","owner":"blax-software","description":"A comprehensive headless e-commerce package for Laravel with stock management, Stripe integration, and product actions.","archived":false,"fork":false,"pushed_at":"2026-01-05T11:29:57.000Z","size":809,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-14T13:56:31.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blax-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-21T10:51:35.000Z","updated_at":"2026-01-05T11:30:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/blax-software/laravel-shop","commit_stats":null,"previous_names":["blax-software/laravel-shop"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blax-software/laravel-shop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blax-software%2Flaravel-shop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blax-software%2Flaravel-shop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blax-software%2Flaravel-shop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blax-software%2Flaravel-shop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blax-software","download_url":"https://codeload.github.com/blax-software/laravel-shop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blax-software%2Flaravel-shop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-15T03:49:45.134Z","updated_at":"2026-01-15T03:49:45.677Z","avatar_url":"https://github.com/blax-software.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Shop Package\n\n[![Tests](https://github.com/blax-software/laravel-shop/actions/workflows/tests.yml/badge.svg)](https://github.com/blax-software/laravel-shop/actions/workflows/tests.yml)\n[![Latest Version](https://img.shields.io/packagist/v/blax-software/laravel-shop.svg?style=flat-square)](https://packagist.org/packages/blax-software/laravel-shop)\n[![License](https://img.shields.io/packagist/l/blax-software/laravel-shop.svg?style=flat-square)](https://packagist.org/packages/blax-software/laravel-shop)\n[![PHP Version](https://img.shields.io/packagist/php-v/blax-software/laravel-shop.svg?style=flat-square)](https://packagist.org/packages/blax-software/laravel-shop)\n\nA comprehensive headless e-commerce package for Laravel with stock management, Stripe integration, and product actions.\n\n## Features\n\n- 🛍️ **Product Management** - Simple, variable, grouped, external, booking, and pool products\n- 💰 **Multi-Currency Support** - Handle multiple currencies with ease\n- 📦 **Advanced Stock Management** - Stock reservations, low stock alerts, and backorders\n- 💳 **Stripe Integration** - Built-in Stripe product and price synchronization\n- 🎯 **Product Actions** - Execute custom actions on product events (purchases, refunds)\n- 🔗 **Product Relations** - Related products, upsells, and cross-sells\n- 🌍 **Translation Ready** - Built-in meta translation support\n- 📊 **Stock Logging** - Complete audit trail of stock changes\n- 🎨 **Headless Architecture** - Perfect for API-first applications\n- ⚡ **Caching Support** - Built-in cache management for better performance\n- 🛒 **Shopping Capabilities** - Built-in trait for any purchaser model\n- 🎭 **Facade Support** - Clean, expressive API through Shop and Cart facades\n- 👤 **Guest Cart Support** - Session-based carts for unauthenticated users\n\n## Installation\n\n```bash\ncomposer require blax-software/laravel-shop\n```\n\nPublish the configuration:\n\n```bash\nphp artisan vendor:publish --provider=\"Blax\\Shop\\ShopServiceProvider\"\n```\n\nRun migrations:\n\n```bash\nphp artisan migrate\n```\n\n## Configuration\n\nThe main configuration file is located at `config/shop.php`. Here you can configure:\n- Database table names\n- Caching settings\n- Stripe integration keys and settings\n- Currency settings\n\n## Quick Start\n\n### Setup Your User Model\n\nAdd the `HasShoppingCapabilities` trait to any model that should be able to purchase products (typically your User model):\n\n```php\nuse Blax\\Shop\\Traits\\HasShoppingCapabilities;\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\n\nclass User extends Authenticatable\n{\n    use HasShoppingCapabilities;\n    \n    // ...existing code...\n}\n```\n\n### Creating Your First Product\n\nUse the provided Enums to ensure type safety and consistency.\n\n```php\nuse Blax\\Shop\\Models\\Product;\nuse Blax\\Shop\\Enums\\ProductType;\nuse Blax\\Shop\\Enums\\ProductStatus;\nuse Blax\\Shop\\Enums\\StockType;\n\n$product = Product::create([\n    'slug' =\u003e 'amazing-t-shirt',\n    'sku' =\u003e 'TSH-001',\n    'type' =\u003e ProductType::SIMPLE,\n    'manage_stock' =\u003e true,\n    'status' =\u003e ProductStatus::PUBLISHED,\n    'name' =\u003e 'Amazing T-Shirt', // Uses meta translation\n    'description' =\u003e 'A comfortable cotton t-shirt',\n]);\n\n// Add Price\n$product-\u003eprices()-\u003ecreate([\n    'currency' =\u003e 'USD',\n    'unit_amount' =\u003e 1999, // $19.99\n    'sale_unit_amount' =\u003e 1499, // $14.99\n    'is_default' =\u003e true,\n]);\n\n// Manage Stock\n$product-\u003eadjustStock(StockType::INCREASE, 100); // Add 100 items to stock\n$product-\u003eadjustStock(StockType::DECREASE, 10); // Remove 10 items from stock\n\n// Reserve Stock (e.g., for a booking)\n$product-\u003eadjustStock(\n    StockType::CLAIMED, \n    1, \n    from: now(), \n    until: now()-\u003eaddDay(), \n    note: 'Reserved for Order #123'\n);\n```\n\n### Working with Cart\n\n```php\nuse Blax\\Shop\\Facades\\Cart;\n\n// Add item to cart\nCart::addToCart($product, 1);\n\n// Add item with date range (for bookings)\nCart::addToCart($product, 1, [], now(), now()-\u003eaddDay());\n\n// Checkout\n$cart = Cart::getCart();\n$cart-\u003echeckout(); // Creates purchases, claims stock, etc.\n```\n\n## Advanced Usage\n\n### Pool Products\n\nPool products are collections of single items (e.g., \"Parking Spaces\" containing \"Spot A1\", \"Spot A2\").\n\n```php\nuse Blax\\Shop\\Models\\Product;\nuse Blax\\Shop\\Enums\\ProductType;\n\n// Create the Pool Parent\n$pool = Product::create([\n    'type' =\u003e ProductType::POOL,\n    'name' =\u003e 'Parking Spaces',\n    'manage_stock' =\u003e true, // Pool manages availability\n]);\n\n// Create Single Items\n$spot1 = Product::create([\n    'type' =\u003e ProductType::BOOKING,\n    'name' =\u003e 'Spot A1',\n]);\n\n$spot2 = Product::create([\n    'type' =\u003e ProductType::BOOKING,\n    'name' =\u003e 'Spot A2',\n]);\n\n// Attach Singles to Pool\n$pool-\u003eattachSingleItems([$spot1-\u003eid, $spot2-\u003eid]);\n```\n\n### Booking Products\n\nBooking products are time-based and require `from` and `until` dates when adding to cart.\n\n```php\nuse Blax\\Shop\\Models\\Product;\nuse Blax\\Shop\\Enums\\ProductType;\n\n$room = Product::create([\n    'type' =\u003e ProductType::BOOKING,\n    'name' =\u003e 'Conference Room',\n    'manage_stock' =\u003e true,\n]);\n\n// Check availability\n$isAvailable = $room-\u003eavailableOnDate(now(), now()-\u003eaddHour());\n```\n\n## Testing\n\nTo run the package tests:\n\n```bash\n./vendor/bin/phpunit\n```\n\nThe tests use an in-memory SQLite database and Orchestra Testbench.\n\n## Documentation\n\nFor more detailed documentation, please refer to the `docs/` directory in the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblax-software%2Flaravel-shop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblax-software%2Flaravel-shop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblax-software%2Flaravel-shop/lists"}