The fluent laravel marketplace

Overview

Latest Version on Packagist MadeWithLaravel.com shield

the marketplace CheatSheet will be availble soon


marketplace provides you the following :

1. Product & Product Variation System

Create simple products, and complex ones using variation system by attaching the product to a specific type.

2. Coupon System

Generate , Validate , and purchase them while checkout easily.

3. Wishlist / Cart System

  • CRUD the wishlist/cart easily
  • get the total/subtotal of the whole cart/wishlist and optionally after sale/coupons applied.
  • stock handling behind the scenes .

4. Category System

  • Attach product, type of products to a category.

5. Sale System

  • Setup sale for category, specific product, type of products.

6. Authorizing Users & Managing Roles.

Installation Steps

1. Require the Package

After creating your new Laravel application you can include the marketplace package with the following command:

composer require sectheater/marketplace:dev-master

2. Add the DB Credentials & APP_URL

Next make sure to create a new database and add your database credentials to your .env file:

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

You will also want to update your website URL inside of the APP_URL variable inside the .env file:

APP_URL=http://localhost:8000

3. Getting Your Environment Ready.

Just Run The following command.

 php artisan sectheater-market:install     
 
Command Interpretation
  • The command just publishes the marketplace's config, migrations,helpers and seeder.

Notice : You may need to run the autoload composer command to reload the changes.

 composer dump-autoload -o 

Another Notice : Don't forget to delete the default users table migration, as marketplace ships with a default one as well.

4. Sample Usage

4.1 Creating a Product with Variation.
Product::generate([
  'user_id' => auth()->id(),
  'name' => 'laptop',
  'description' => 'Fancy laptop',
  'price' => 15000,
  'category' => 'electronics',
  'type' => ['name' => 'MacBook Pro', 'stock' => 20],
  'details' => ['color' => 'Silver', 'dummy-feature' => 'dummy-text']
);
4.2 Filter products by criteria.
Product::fetchByVariations(['locations' => 'U.K', 'variations' => ['size' => 'XL', 'color' => 'red'], 'categories' => 'clothes']);
  • Add custom Criterion and use it while searching.
4.3 get Cart total/subtotal.

Out of the blue, you may use a couple of methods to retrieve the total/subtotal

Cart::subtotal();
Cart::total(); // returns total after applying tax.
Cart::total($coupons); // Collection of coupons passed, returns total after applying tax and coupons.
Cart::subtotalAfterCoupon($coupons);

Suprisingly every single method you can use for a cart, you can use for a wishlist ( since we can consider it as a virtual cart )

4.4 get Cart item .
Cart::item(1); // get the item with id of 1

Cart::item(1,  ['color' => 'blue', 'size' => 'L']); // get the item with the id of 1 and should have these attributes.

Cart::item(null, ['color' => 'blue','size' => 'L']); // get the current authenticated user's cart which has these attributes assuming that these attributes identical to the database record.

Cart::item(null, ['color' => 'blue','size' => 'L'] , 'or');  // get the current authenticated user's cart which has any of these attributes.
4.4 Generate Coupons.
Coupon::generate([
  'user_id' => auth()->id(),
  'active' => true,
  'percentage' => 10.5,
  'expires_at' => Carbon::now()->addWeeks(3)->format('Y-m-d H:i:s')
]);
4.5 Validate Coupons.
$coupon = Coupon::first(); // valid one
Coupon::validate($coupon); // returns true
4.6 Deactivate Coupons.
$coupon = Coupon::first(); 
Coupon::deactivate($coupon->id);
4.7 Purchas Coupons.
$coupon = Coupon::first();
Coupon::purchase($coupon); // Purchase the coupon for the current authenticated user.
Coupon::purchase($coupon, $anotherUser); // Purchase the coupon for the passed user.
4.7 Purchased Coupons.
  • It releases the invalid purchased coupons automatically.
Coupon::purchased(); // returns the only valid purchased coupons.
4.8 Apply Specific Coupons.
  • Assuming the user has a couple of coupons, he can designate which of them that can be applied on a specific product.
Coupon::appliedCoupons($coupons); // returns a query builder.

For more, you can view the docs.

You might also like...
A e-commerce website with Laravel, Vue

A eCommerce using Laravel Version: 1.0 Release of the Laravel eCommerce. Technologies and libraries Laravel 7+, PHP 7+. JavaScript & VueJS Framework.

A PayPal IPN client for Laravel.

PayPal IPN for Laravel 4 This package allows for the painless creation of a PayPal IPN listener in the Laravel 4 framework. Installation PayPal IPN fo

AvoRed an Open Source Laravel Shopping Cart

AvoRed is commin up as a headless graphql version. AvoRed is a free open-source e-commerce platform written in PHP based on Laravel. Its an ingenuous

Laravel paypal payment package , help you process credit card payment using paypal api
Laravel paypal payment package , help you process credit card payment using paypal api

Important :The use of the PayPal REST /payments APIs to accept credit card payments is restricted by paypal and they recomand to use Braintree Direct

Laravel plugin for processing payments through PayPal. Can be used separately.

Laravel PayPal Documentation Usage Support Documentation The documentation for the package can be viewed by clicking the following link: https://srmkl

Laravel Shopping Cart Package

LaraCart - Laravel Shopping Cart Package (http://laracart.lukepolo.com) Features Coupons Session Based System Cross Device Support Multiple cart insta

An E-Commerce package for Laravel with Grafite CMS. Take control of your content and how you sell it! Products, subscriptions, shipping, downloading and more!

Grafite Commerce Grafite has archived this project and no longer supports or develops its code. We recommend using only as a source of ideas for your

AvoRed an Open Source Laravel Shopping Cart

AvoRed is commin up as a headless graphql version. AvoRed is a free open-source e-commerce platform written in PHP based on Laravel. Its an ingenuous

A developer-friendly e-commerce foundation for your Laravel app

laravel-shopr A developer-friendly e-commerce foundation for your Laravel app. All the features you need for your webshop but without sacrificing you

Comments
  • Create LICENSE

    Create LICENSE

    IMPORTANT: Please do not create a Pull Request without creating an issue first.

    Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

    Please provide enough information so that others can review your pull request:

    Explain the details for making this change. What existing problem does the pull request solve?

    Test plan (required)

    Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

    Code formatting

    Closing issues

    Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

    opened by SecTheater 0
  • Create CODE_OF_CONDUCT.md

    Create CODE_OF_CONDUCT.md

    IMPORTANT: Please do not create a Pull Request without creating an issue first.

    Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

    Please provide enough information so that others can review your pull request:

    Explain the details for making this change. What existing problem does the pull request solve?

    Test plan (required)

    Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

    Code formatting

    Closing issues

    Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

    opened by SecTheater 0
Releases(v1.0.2)
Owner
Security Theater
Security Theater
Commerce GrappQL Package for Laravel

Sailwork Commerce Package for Laravel Document Please read document in here: Document Installation You can install the package via composer: composer

Sail Work 6 May 10, 2021
A robust session-based shopping bag for Laravel

Shopping Bag A robust session-based shopping bag for Laravel Go to documentation Documentation Documentation for Shopping Bag can be found in the docs

Laraware 30 Dec 13, 2021
Laravel FREE E-Commerce Software

Laravel FREE E-Commerce Software

Jeff Simons Decena 1.7k Dec 24, 2022
Antvel is an ecommerce project written in Laravel 5.* intended for building a friendly eStore either for startups or big companies.

Antvel is an ecommerce project written in Laravel 5.* intended for building a friendly eStore either for startups or big companies.

Antvel - Official 650 Dec 28, 2022
A free open source e-commerce platform for online merchants based on customised version of Laravel.

A free open source e-commerce platform for online merchants based on customised version of Laravel.

Ace Vinayak 58 Oct 19, 2022
A Free and Opensource Laravel eCommerce framework built for all to build and scale your business.

Bagisto is a hand tailored E-Commerce framework built on some of the hottest opensource technologies such as Laravel (a PHP framework) and Vue.js a progressive Javascript framework.

Bagisto 5k Jan 5, 2023
Integrated online shop based on Laravel LTS and the Aimeos e-commerce framework

⭐ Star us on GitHub — it motivates us a lot! ?? Aimeos Laravel ecommerce platform Aimeos is THE professional, full-featured and high performance e-com

Aimeos 3k Jan 5, 2023
Simple E-Comerce build use Laravel 5.6 require php version 5.6 or 7.4

Simple E-Comerce build use Laravel 5.6 require php version 5.6 or 7.4

Rangga Darmajati 3 Oct 7, 2021
Payu payment gateway for bagisto laravel ecommerce open source platform

Bagisto Payu Payment Gateway Payu is a popular payment gateway in india. This package provides a additional strong help for the user to use the payu p

Saju G 3 Dec 14, 2021
E-Commerce Laravel Project

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Mohamed Fadl 2 Dec 10, 2022