Giter Site home page Giter Site logo

laravel-ecommerce's Introduction

WARNING: STILL IN DEVELOPMENT - DO NOT USE YET

Laravel Ecommerce

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Opinionated ecommerce tools for laravel

Introduction

In a lot of projects, we encounter the same dilemma: we need to provide a customer with an "Ecommerce" website (basically, he needs to sell either a product or a service) which doesn't "fit" in the standard definition of ecommerce (ie: what you can easily build on top of the popular ecommerce CMSes, like Prestashop, Magento, Woocommerce, etc), or with the usual SaaS (Shopify, Webflow, SnipCart, etc)

The natural question that arises for us is then: do we customize these CMSes to suite the particular business case of the client, or build a custom Laravel application while having to deal with all the standard (and always "expected") ecommerce features, like cart, orders, notifications, inventory, coupons, taxes, customers, etc?

This is why Laravel Ecommerce was born: to provide most of these standard ecommerce features to any Laravel Application that needs them, allowing us to leverage them, without having to rebuild them from scratch every time.

It is very opinionated, meaning we put some "assertions" in place to allow us to build upon a few "certainties".

Prerequisites

  1. Everything you sell is an Eloquent Model.
  2. Everything you sell needs to be added to the cart in order to be purchased.
  3. Everything you sell has a price, and the model itself is able to calculate it.

Design Choices

  • In v1 we support only the Single Store model. For v2 we plan to add support for Multiple Store, with a Store Provider.
  • Each "thing" you add to the cart is an Eloquent Model. This is done in order to take advantage of the Polymorphic relationships, while keeping the maximum flexibility.
  • Everything related to "prices" is a MoneyPHP object. For this we use the excellent cknow/laravel-money wrapper for laravel
  • We use commerceguys/addressing to deal with addresses and zones in general
  • We use commerceguys/tax to deal with taxes
  • We use iben12/laravel-statable to deal with order management through a state machine.
  • We use barryvdh/laravel-omnipay to deal with payment gateways.
  • We provide Laravel Nova Fields / Resources / Tools as an optional way to interact with the package resources.
  • We provide views / assets / etc that can be used to speed up the frontend work
  • We provide default emails to be sent on specific events
  • We trigger a lot of events, to allow for maximum customization
  • Every class used and provided can be swapped from the configuration file.

Installation

You can install the package via composer:

composer require weble/laravel-ecommerce

Notes

  • Using more than 1 currency => publish swap config and configure it (add cache probably)
  • Using payments => publish omnipay config
  • Want nova? Install weble/laravel-ecommerce-nova
  • TODO: migrations (publish vs load from)
  • BEWARE: of changing the default currency if you don't store the currency itself in the db too

Usage

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-ecommerce's People

Contributors

npvnll avatar skullbock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.