Download the PHP package al-mamun-devops/laravel-shopping-cart without Composer

On this page you can find all versions of the php package al-mamun-devops/laravel-shopping-cart. 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 laravel-shopping-cart

🛒 Laravel Shopping Cart

A lightweight and reusable shopping cart package for Laravel 12+, designed for developers who want to add cart functionality without needing a database. This package uses Session or File Storage for managing cart data.


🚀 Features


📦 Installation

1. Add the package via Composer (local or from GitHub)

2. Publish configuration file

This will publish config/shoppingcart.php where you can choose storage type:


⚙️ Configuration

You can choose between Session and File Storage:

Option Description
session Stores cart data in the Laravel session. Default option.
file Persists cart data in a JSON file under storage/app/shopping_cart.json.

Set your preferred option in the .env file:


🧰 Usage

Use the Cart Facade to manage cart operations:


🧩 Example Controller


🧱 Folder Structure


🧠 Methods Summary

Method Description
add($id, $name, $price, $quantity = 1, $attributes = []) Add an item to the cart
update($id, $quantity) Update the quantity of an item
remove($id) Remove an item from the cart
clear() Clear all items from the cart
all() Retrieve all cart items
total() Calculate total price
count() Count total number of items

🧑‍💻 Development Setup

If you are developing this package locally within a Laravel app:

  1. Place the package inside packages/al-mamun-devops/laravel-shopping-cart
  2. Add this to your main app’s composer.json:

  3. Run:

  4. Test it in your app!

🪪 License

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


👨‍💻 Author

Md Al Mamun
GitHub: al-mamun-devops


💡 Contributing

Pull requests are welcome! If you’d like to enhance the package (e.g. add Redis, Cookie storage, or tests), feel free to open an issue or PR.


⭐ Star the Repo

If you find this package helpful, please give it a ⭐ on GitHub to support future development!


All versions of laravel-shopping-cart with dependencies

PHP Build Version
Package Version
No informations.
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 al-mamun-devops/laravel-shopping-cart contains the following files

Loading the files please wait ...