dystcz / lunar-api
Lunar API
Requires
- php: ^8.2
- illuminate/support: ^10.0
- laravel-json-api/hashids: ^2.0
- laravel-json-api/laravel: ^3.4
- laravel-json-api/non-eloquent: ^3.0
- lunarphp/lunar: ^0.8
Requires (Dev)
- barryvdh/laravel-ide-helper: ^2.13
- driftingly/rector-laravel: ^0.17.0
- laravel-json-api/testing: ^2.1
- laravel/pint: ^1.7
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- rector/rector: ^0.15.23
- spatie/laravel-ray: ^1.32
- dev-main
- 1.0.x-dev
- 0.8.x-dev
- 0.8.10
- 0.8.9
- 0.8.8
- 0.8.7
- 0.8.6
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.x-dev
- 0.7.9
- 0.7.8
- 0.7.7
- 0.7.6
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.x-dev
- 0.5.x-dev
- dev-feature/dev-338-add-cash-on-delivery-payment-adapter-and-finish-purchasable
- dev-stock-management-improvements
- dev-feature/dyst-455-purchasable-payment-options-within-lunar-api
- dev-feature/dev-296-add-manual-cart-handling-flow
- dev-feature/dev-329-lunar-v100-alpha
- dev-feature/dev-328-lunar-10-and-laravel-11
- dev-feature/fix-find-order-by-actions
- dev-docs/create-documentation
- dev-fix/filter-products-by-slug
- dev-feature/add-more-tests-1
- dev-feature/add-policy-for-every-schema
- dev-feature/update-order-observer
- dev-feature/configurable-non-eloquent-purchasable-types
- dev-feature/update-order-lines
- dev-feature/simplify-config
- dev-feature/find-order-redundancy
- dev-feature/update-collections-schema
- dev-feaure/update-postman-collection
- dev-feature/payments-custom-amount-cart-address-meta
- dev-feature/update-payments
- dev-feature/add-postman-collection
- dev-feature/upgrade-to-lunar-0.8
- dev-feature/add-collection-group-filters
- dev-feature/filters
- dev-feature/upgrade-to-lunar-0.7.5
- dev-feature/apply-published-scope-for-products
- dev-update-lunar-073
- dev-feature/use-attribute-dropdown-label-as-value
- dev-feature/fix-checking-order-signatures
- dev-feature/in-stock-product-filter
- dev-feature/swappable-checkout-cart-action
- dev-feature/dyst-328-global-manifest
- dev-feature/dyst-307-upgrade-schema-manifest
- dev-feature/dyst-306-add-rest-of-jsonapi-boilerplate
- dev-feature/dyst-308-add-policy-for-every-schema
- dev-feature/add-hashids-tests
- dev-feature/relation-naming-consistency
- dev-feature/translatable-validation-messages
- dev-dev
- dev-feature/hashids
- dev-feature/transactions
This package is auto-updated.
Last update: 2024-04-18 09:19:51 UTC
README
What's going on here?
This package introduces an API layer for the Lunar ecommerce package. It connects the Lunar backend with your SPA, other applications, and possibly with a mobile app.
The main aim is to provide a solid foundation for your e-commerce project, giving you a head start while maintaining flexibility so you can easily build features to meet your project's needs.
Some perks
- Focus on extensibility
- Wannabe ecosystem of complementary packages with emphasis on the plug and play spirit
- Already running in production 🤫
- Built on top of Laravel JSON:API
Feature set
- Configurable checkout flow with guest checkout
- Solid extensibility (Models, Schemas, Resources, Routes, ...)
- Payment adapters registrar (currently Stripe & Mollie)
Work in progress 🚧
- Documentation Wiki
- Vitepress documentation
- Better test coverage
- Paypal payment adapter
- Custom model filters
- Composable products (good for configurators)
- Purchasable payment options
- HashIds
Planned 🕛
- Automated Open API documentation
- Authentication flow (currently has to be implemented in the main app)
- More streamlined configuration
Feature requests and ideas 💡
Got an idea? Share it in a dicussion or create an issue.
Getting started guide
Requirements
- PHP ^8.2
- Laravel 10
- Lunar requirements
Installation
You can install the package via composer
composer require dystcz/lunar-api
Publish config files
You will probably need them pretty bad
php artisan vendor:publish --provider="Dystcz\LunarApi\LunarApiServiceProvider" --tag="lunar-api"
Publish migrations
Only in case you want to customize the database schema
php artisan vendor:publish --provider="Dystcz\LunarApi\LunarApiServiceProvider" --tag="lunar-api.migrations"
Let's hit your first endpoint
Just visit /api/v1/products
and you should see a list of products.
Hopefully everything went smooth so far. If not, please create an issue.
You can view the rest of the API routes by running php artisan route:list --name=v1
in your terminal.
Useful resource
- Postman request collection [🚧] , so you can test the API with ease
- Laravel JSON:API Docs , if you plan to extend the API
Testing
composer test
Lunar API compatible packages
- Reviews (Adds user reviews functionality)
- Product Views (Store unique product views in Redis)
- Product Stock Notifications (Notify users when product is in stock again)
- Newsletter (Newsletter sign up with support for Mailchimp / Mailcoach / Brevo)
- Stripe Payment Adapter
- Mollie Payment Adapter
- PayPal Adapter [🚧]
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email dev@dy.st instead of using the issue tracker.
Credits
- All Contributors
- Lunar for providing awesome e-commerce package
- Laravel JSON:API which is a brilliant JSON:API layer for Laravel applications
License
The MIT License (MIT). Please see License File for more information.