bhavinjr/laravel-wishlist
Composer 安装命令:
composer require bhavinjr/laravel-wishlist
包简介
wishlist for laravel 5.*.*
关键字:
README 文档
README
A simple Wishlist implementation for Laravel 5...
Installation
First, you'll need to install the package via Composer:
$ composer require bhavinjr/laravel-wishlist
If you are don't use using Laravel 5.5.* Then, update config/app.php by adding an entry for the service provider.
'providers' => [ // ... Bhavinjr\Wishlist\Providers\WishlistServiceProvider::class, ]; 'aliases' => [ //... "Wishlist": "Bhavinjr\Wishlist\Facades\Wishlist", ];
In command line paste this command:
php artisan config:cache
In command line again, publish the default configuration file:
php artisan vendor:publish --provider="Bhavinjr\Wishlist\Providers\WishlistServiceProvider"
In command line paste this command:
php artisan migrate
Configuration
Configuration was designed to be as flexible.
global configuration can be set in the config/wishlist.php file.
return [
'product_model' => 'App\Models\Product',
];
after update config/wishlist.php file.
php artisan config:cache
Usage
The package gives you the following methods to use:
Adding an item to the wishlist is really simple
you need specify product_id and user_id respectively all parameter are compulsory
Wishlist::add()
Wishlist::add(15, 1);
Wishlist::remove()
To remove an item from the wishlist, specify the wishlist_id.
Wishlist::remove(2);
Wishlist::getUserWishlist()
To get users all wishlist item, specify the user_id.
Wishlist::getUserWishlist(1);
Wishlist::removeUserWishlist()
To remove users all wishlist item, specify the user_id.
Wishlist::removeUserWishlist(1);
Wishlist::removeByProduct()
To remove particular product using product_id, specify the product_id and user_id respectively.
Wishlist::removeByProduct(15, 1);
Wishlist::count()
To count users all wishlist item, specify the user_id.
Wishlist::count(1);
Wishlist::getWishlistItem()
To get particular wishlist item, specify the product_id and user_id respectively
Wishlist::getWishlistItem(15, 1);
You can also load product detail
$result = Wishlist::getUserWishlist(1)->load('product'); or you can also access directly
bhavinjr/laravel-wishlist 适用场景与选型建议
bhavinjr/laravel-wishlist 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.35k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2017 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「wishlist」 「laravel ecommerce」 「laravel wishlist」 「wishlist laravel」 「ecommerce laravel wishlist」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bhavinjr/laravel-wishlist 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bhavinjr/laravel-wishlist 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bhavinjr/laravel-wishlist 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Nevogate Payment Gateway SDK
Manage your users' wishes in a Laravel app
A CakePHP plugin for managing user favorites, bookmarks and wishlists
Dealing with payments through the Egyptian payment gateway PayMob
A PHP (and Laravel) package to interface with the Snipcart api.
Wishlist bundle for Sylius e-commerce platform.
统计信息
- 总下载量: 1.35k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 8
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-12