LaravelPackages.net
Acme Inc.
Toggle sidebar
yaroslawww/laravel-quick-checkout

Create simple checkout process using only session.

7
0
1.0.0
About yaroslawww/laravel-quick-checkout

yaroslawww/laravel-quick-checkout is a Laravel package for create simple checkout process using only session.. It currently has 0 GitHub stars and 7 downloads on Packagist (latest version 1.0.0). Install it with composer require yaroslawww/laravel-quick-checkout. Discover more Laravel packages by yaroslawww or browse all Laravel packages to compare alternatives.

Last updated

Simple checkout process using session.

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

Installation

Install the package via composer:

composer require yaroslawww/laravel-quick-checkout

You can publish the config file with:

php artisan vendor:publish --provider="QuickCheckout\ServiceProvider" --tag="config"

Usage

Example usage:

public function addToCart(Course $course) { /** @var \QuickCheckout\Cart $cart */ $cart = \QuickCheckout\Checkout::cart()->purge() ->withLineItem($course->toCheckoutProduct(), 2) ->withLineItem(new Product('My other product', 123), 4) ->putToSession(); // ... response or redirect } public function showCheckout(Course $course) { /** @var \QuickCheckout\Cart $cart */ $cart = \QuickCheckout\Checkout::cart()->fromSession(); // ... response or redirect }

Model configuration:

use Illuminate\Database\Eloquent\Model; use QuickCheckout\Contracts\UsedAsCheckoutProduct; use QuickCheckout\Eloquent\AsCheckoutProduct; class Course extends Model implements UsedAsCheckoutProduct { use AsCheckoutProduct; // ... }

Credits

  • Think Studio

Star History Chart