Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Checkout Laravel Package

spatie/checkout

Laravel package to manage the current order ID during a webshop checkout. Store the newly created order ID in the session and retrieve it later via a simple facade/API, keeping checkout steps clean and consistent across requests.

View on GitHub
Deep Wiki
Context7

Remember the order id in the checkout process of a webshop

Build Status Latest Stable Version License

When building a checkout process for a webshop, you likely discovery a need to store the id of a newly created order in a session. This Laravel package provides a clean way to work the order id in the session.

Support us

Learn how to create a package like this one, by watching our premium video course:

Laravel Package training

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Postcardware

You're free to use this package (it's MIT-licensed), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

Installation

This package can be installed through Composer.

composer require spatie/checkout

There is a service provider you can make use of.


// app/config/app.php

'providers' => [
    '...',
    'Spatie\Checkout\CheckoutServiceProvider'
];

This package also comes with a facade, which provides an easy way to use this class.


// app/config/app.php

'aliases' => array(
	...
	'Checkout' => 'Spatie\Checkout\CheckoutFacade',
)

Usage

You can store the order id using this method:

    Checkout::setCurrentOrderId($yourOrderId);

Your order id will be stored in Laravel's session store.

You can retrieve the value with:

    Checkout::getCurrentOrderId();

These methods are also provided:

  • Checkout::clearCurrentOrderId(): Forget the previously stored value.
  • Checkout::isCurrentOrderId($orderId): Convenient method to determine if the given orderId is equal to the value stored with the previous call to setCurrentOrderId.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport