PHP code example of bhavinjr / laravel-wishlist

1. Go to this page and download the library: Download bhavinjr/laravel-wishlist library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bhavinjr / laravel-wishlist example snippets


'providers' => [
    // ...
    Bhavinjr\Wishlist\Providers\WishlistServiceProvider::class,
];

'aliases' => [
    //...
    "Wishlist": "Bhavinjr\Wishlist\Facades\Wishlist",
];

Wishlist::add(15, 1);

Wishlist::remove(2);

Wishlist::getUserWishlist(1);

Wishlist::removeUserWishlist(1);

Wishlist::removeByProduct(15, 1);

Wishlist::count(1);

Wishlist::getWishlistItem(15, 1);

$result  =  Wishlist::getUserWishlist(1)->load('product');

or you can also access directly
shell
php artisan config:cache
shell
php artisan vendor:publish --provider="Bhavinjr\Wishlist\Providers\WishlistServiceProvider"
shell
php artisan migrate

return [
    'product_model'         =>  'App\Models\Product',
];
shell
php artisan config:cache