Download the PHP package javcorreia/laravel-wishlist without Composer

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

laravel-wishlist

A simple Wishlist implementation for Laravel 5.8|6.*|7.*|8.*|9.*|10.*

If you have problems with the minimum PHP version of 8.0: install previous stable version 2.2

Latest Stable Version License Total Downloads

This is a fork of the excellent Bhavinjr's laravel-wishlist.

I've added the possibility to save a wishlist associated with a custom session id, instead of just a user_id, making it more flexible.
It's also possible to extend the default Model wishlist model to add soft deletes possibility, if needed.

Hence, the table was changed a bit, as well as the methods.

Installation

Is installed via Composer by running in your project's root.

Publish the default configuration file:

Before running migration, edit the required settings using the resulting config/wishlist.php file (See Configuration).

To create the table run migrations:

Configuration

Configuration was designed to be as flexible as changing the global configuration in the config/wishlist.php file.
You will need to provide at least, the model for the items to be wishlisted, for example:

The other values can be the default ones, unless changes are needed.

After updating the config/wishlist.php file execute the following command to cache configs:

Extending the Base Model to extra functionalities

If needed you can create a Model file, extend the base Wishlist model to add extra functionalities.
In the following example, we'll add the SoftDeletes trait to have soft deletes in the wishlist table.

Create a migration to add soft delete functionality to the wishlist table

In the migration:

Run migrate to update table:

Extend the base model

Create the model:

Add the SoftDeletes trait:

Change config to use your new Model class

In wishlist.php config file:

Usage

Just use the provided facade to access its methods.

Hint: use Laravel IDE Helper Generator to have code completion on facade methods

The package gives you the following methods to use:

Adding an item to the wishlist is really simple

you need specify the item to add and the user to add it to respectively.
These two parameters are required.

type ['user', 'session'] is an optional parameter which tells the service if the user is an application authenticated user_id or
a custom session/cookie id.

Wishlist::add(item, user[, type='user'])

Wishlist::remove(id, user[, type='user'])

To remove an item from the wishlist, specify the wishlist_id and the user associated with the item.

type ['user', 'session'] is an optional parameter wich tells the service if the user is an application authenticated user_id or
a custom session/cookie id.

Wishlist::getUserWishList(user[, type='user'])

To get all wishlist items from a user, specify the user_id.

type ['user', 'session'] is an optional parameter wich tells the service if the user is an application authenticated user_id or
a custom session/cookie id.

Wishlist::removeUserWishList(user[, type='user'])

To remove all wishlist items from a user, specify the user_id.

type ['user', 'session'] is an optional parameter wich tells the service if the user is an application authenticated user_id or
a custom session/cookie id.

Wishlist::removeByItem(item, user[, type='user'])

To remove a particular item, specify the item and user respectively.

type ['user', 'session'] is an optional parameter wich tells the service if the user is an application authenticated user_id or
a custom session/cookie id.

Wishlist::count(user[, type='user'])

Total wishlist items from a user.

Wishlist::getWishListItem(item, user[, type='user'])

To get particular wishlist item, specify the item and user respectively.

type ['user', 'session'] is an optional parameter wich tells the service if the user is an application authenticated user_id or
a custom session/cookie id.

Wishlist::assocSessionWishListToUser(user_id, session_id)

To associate a particular session_id wishlist to an authenticated user.
A user who has number of favorites while unlogged, if he logins, this method could be run to preserve the potentialy new wishlist items.

You can the load item detail using laravel Eloquent association:

or you can access it directly invoking the appropriate Eloquent model


All versions of laravel-wishlist with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^5.8|^6.0|^7.0|^8.0|^9.0|^10.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 javcorreia/laravel-wishlist contains the following files

Loading the files please wait ....