Download the PHP package davidiwezulu/ecommerce without Composer

On this page you can find all versions of the php package davidiwezulu/ecommerce. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ecommerce

🎉 Laravel E-Commerce Package

Latest Version on Packagist Tests License: MIT

Introduction

After letting this gem sit in a private repository for way too long, I decided it was time to dust it off, give it a serious makeover, and finally share it with everyone. What started as a personal side project has now evolved into a full-fledged e-commerce package 🚀.

Overview

An extensible Laravel package providing robust e-commerce functionalities, including cart management, order processing, admin operations, flexible tax calculations, and seamless payment gateway integration (Stripe and PayPal). Designed without a predefined UI to offer maximum flexibility, allowing integration with any Laravel backend, controllers, or views.

Laravel Version Compatibility

This package is compatible with the following Laravel versions:

Laravel Version Supported
8.x ✅ Yes
9.x ✅ Yes
10.x ✅ Yes

Requirements

Table of Contents

Features

Installation

Step 1: Install the Package

Use Composer to install the package into your Laravel application:

Step 2: Publish Configuration and Migrations

Important: Before running migrations, ensure you have configured the package according to your application's needs. This includes setting up currency, tax settings, payment gateways, and customizing models if necessary.

Publish the package's configuration file and migrations:

Step 3: Configure the Package

Edit the config/ecommerce.php file to suit your application's requirements. Ensure all configurations are set correctly before proceeding to migrations.

Step 4: Run Migrations

Run the migrations to create the necessary database tables:

Configuration

The package provides a configuration file located at config/ecommerce.php, allowing you to customize various aspects.

Important Note

Configure the package before running migrations. This ensures that your custom settings, such as table names and model classes, are correctly applied during the migration process.

Currency Settings

Set your application's default currency in the .env file:

Or directly in config/ecommerce.php:

Tax Settings

Configure tax settings in the .env file:

Or directly in config/ecommerce.php:

Payment Gateways

Stripe Configuration

In your .env file:

In config/ecommerce.php:

PayPal Configuration

In your .env file:

In config/ecommerce.php:

Custom Models

You can override the default models used by the package in config/ecommerce.php:

Database Migrations

The package provides migrations for creating necessary database tables. If you've customized table names or models, ensure that these are correctly set in the configuration before running migrations.

Important: Always back up your database before running new migrations, especially in production environments.

Usage

Cart Management

Manage cart items using the Cart facade.

Adding or Updating Cart Items

Removing Cart Items

Retrieving Cart Items

Clearing the Cart

Admin Operations

Admins can manage products and inventory using the Admin facade.

Adding a New Product with Tax Rate

Updating an Existing Product

Updating Inventory

Order Processing

Use the Order facade to create orders and process payments.

Stripe Payment Example

PayPal Payment Example

Step 1: Initiate PayPal Payment

Step 2: Handle PayPal Return (After User Approval)

Create routes in your web.php:

Implement the controller methods:

Tax Calculations

The package supports flexible tax calculations, including per-product tax rates and configurable default tax rates.

Adding a Product with a Specific Tax Rate

Calculating Tax in Cart Items

When you add or update items in the cart, the tax amount is automatically calculated based on the product's tax rate or the default tax rate.

Extending the Package

Custom Models

Benefit of Custom Models: Defining models in the configuration allows you to override or extend the default models provided by the package with your own custom models. This provides flexibility to add custom methods, relationships, and business logic specific to your application.

Extend Package Models (Optional)

You can extend the package's default models if you want to retain the base functionality while adding your customizations.

Example:

Update Configuration:

In config/ecommerce.php:

Explanation:

By extending BaseProduct, you retain all the original functionality provided by the package. You can add new relationships, methods, accessors, and mutators in your custom Product model. The package will use your custom model throughout its operations.

Adding Custom Payment Gateways

You can add new payment gateways by implementing the PaymentGatewayInterface.

Create a Custom Gateway Class

Register the Custom Gateway

In config/ecommerce.php:

License

This package is open-sourced software licensed under the MIT license.

Conclusion

The Laravel E-commerce package provides a comprehensive solution for implementing e-commerce functionality in your Laravel application. With features like flexible tax calculations, seamless payment gateway integration, and customizable models, it offers a solid foundation for building robust online stores.

Important: Remember to configure the package appropriately before running migrations to ensure a smooth integration with your application.

For any questions or contributions, feel free to open an issue or submit a pull request on GitHub.

Thank you for choosing the Laravel E-commerce package!


All versions of ecommerce with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version ^8.0|^9.0|^10.0
paypal/paypal-checkout-sdk Version ^1.0
stripe/stripe-php Version ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package davidiwezulu/ecommerce contains the following files

Loading the files please wait ....