Download the PHP package binafy/laravel-cart without Composer

On this page you can find all versions of the php package binafy/laravel-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-cart

Laravel Cart

binafy-laravel-cart

PHP Version Require Latest Stable Version Total Downloads License Passed Tests

Introduction

The Laravel Cart is a highly customizable and flexible package that integrates basket functionality into your Laravel application. It simplifies storing and managing cart items, supporting multiple item types and quantities. It is ideal for e-commerce platforms to create carts, attach items, and manage them efficiently. Installation is straightforward via Composer, and it offers robust features like secure item storage, easy cart manipulation, and seamless integration with your existing Laravel app.

Features

The Laravel Cart package is an ideal choice for developers looking to implement a reliable and scalable cart system in their Laravel-based e-commerce applications:

Installation

You can install the package with Composer:

Publish

If you want to publish a config file, you can use this command:

If you want to publish the migrations, you can use this command:

For convenience, you can use this command to publish config, migration, and ... files:

After publishing, run the php artisan migrate command.

Usage

Configuration

You can config the Laravel Cart with laravel-cart.php config that exists in config folder.

Laravel Cart Facade

For convenience, you can use Laravel Cart facade to store, delete, and ...:

Driver

If you may to using Laravel Cart facade, you can change the driver for store, delete, and ...:

The default driver is database and if you would to change the driver, you need to use the Laravel Cart config file that exists on config\laravel-cart.php.

Support Drivers

Drivers Name
Session session
Database database

Laravel Cart Model

Also, you are able to use Laravel Cart models for fetch or ... with Laravel Eloquent.

Store Cart

For storing a new cart, you can use Cart model:

Access Itemable

If you want to access to itemable in CartItem, you can use itemable relation:

Create Cart With Storing Item

For storing an item for cart, you need to implement Cartable interface to your model.

After, you can store items in multiple ways:

Store multiple items

If you may to store multiple items for a cart, you can use storeItems method:

Store Item For a Cart

If you want to store items for cart, first you need to create a cart and attach items to cart:

If you may to access the items of one cart, you can use items relation that exists in Cart model.

For conveniences, you can use storeItem method. This method take a model or array:

Delete Item From Cart

If you may to delete an item for a cart, you can use removeItem method:

Delete All Items From Cart

If you may to delete all items from a cart, you can use emptyCart method:

Increase Quantity

If you may to increase the quantity of item in cart, you can use increaseQuantity method:

Decrease Quantity

If you may to decrease the quantity of item in cart, you can use decreaseQuantity method:

Available Events

The Laravel Cart have some events that you can listen to these event and doing something:

Events Description
LaravelCartStoreItemEvent When you store an item in cart, this event fired
LaravelCartRemoveItemEvent When you remove an item from cart, this event fired
LaravelCartEmptyEvent When you remove all items from cart, this event fired
LaravelCartIncreaseQuantityEvent When you increase the quantity of item in cart, this event fired
LaravelCartDecreaseQuantityEvent When you decrease the quantity of item in cart, this event fired

Contributors

Thanks to all the people who contributed. Contributors.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Changelog

The changelog can be found in the CHANGELOG.md file of the GitHub repository. It lists the changes, bug fixes, and improvements made to each version of the Laravel User Monitoring package.

License

The MIT License (MIT). Please see License File for more information.

Donate

If this package is helpful for you, you can buy a coffee for me :) ❤️


All versions of laravel-cart with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version >=9.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 binafy/laravel-cart contains the following files

Loading the files please wait ....