seandowney/backpackstorecrud
Composer 安装命令:
composer require seandowney/backpackstorecrud
包简介
Basic Store management interface for Laravel 5 using Backpack CRUD.
README 文档
README
An admin interface to easily add/edit/remove Store Products and Categories, using Laravel Backpack.
Install
1) In your terminal:
$ composer require seandowney/backpackstorecrud
2) Add the service provider to your config/app.php file:
SeanDowney\BackpackStoreCrud\StoreCrudServiceProvider::class,
3) Publish the config file & run the migrations
$ php artisan vendor:publish --provider="SeanDowney\BackpackStoreCrud\StoreCrudServiceProvider" #publish config, view and migration files
$ php artisan migrate #create the store tables
4) [Optional] Add a menu item for it in resources/views/vendor/backpack/base/inc/sidebar.blade.php or menu.blade.php:
<li class="nav-item nav-dropdown">
<a class="nav-link nav-dropdown-toggle" href="#"><i class="nav-icon fa fa-group"></i> <span>Store</span> <i class="fa fa-angle-left pull-right"></i></a>
<ul class="nav-dropdown-items">
<li class="nav-item"><a class="nav-link" href="{{ backpack_url(config('seandowney.storecrud.route_prefix', 'store').'/product') }}"><i class="nav-icon fa fa-newspaper-o"></i> <span>Products</span></a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url(config('seandowney.storecrud.route_prefix', 'store').'/category') }}"><i class="nav-icon fa fa-newspaper-o"></i> <span>Categories</span></a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url(config('seandowney.storecrud.route_prefix', 'store').'/price_option') }}"><i class="nav-icon fa fa-list"></i> <span>Price Options</span></a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url(config('seandowney.storecrud.route_prefix', 'store').'/price_group') }}"><i class="nav-icon fa fa-tag"></i> <span>Price Groups</span></a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url(config('seandowney.storecrud.route_prefix', 'store').'/delivery_option') }}"><i class="nav-icon fa fa-list"></i> <span>Delivery Options</span></a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url(config('seandowney.storecrud.route_prefix', 'store').'/delivery_group') }}"><i class="nav-icon fa fa-tag"></i> <span>Delivery Groups</span></a></li>
<li class="nav-item"><a class="nav-link" href="{{ backpack_url(config('seandowney.storecrud.route_prefix', 'store').'/order') }}"><i class="nav-icon fa fa-tag"></i> <span>Orders</span></a></li>
</ul>
</li>
5) [Optional] Add a basic Store frontend using the base controllers.
- Add the Stripe settings to the
config/services.phpfile in your project'stripe' => [ 'model' => App\User::class, 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), 'endpoint_secret' => env('STRIPE_ENDPOINT_SECRET'), ], - Add the Stripe public key to you page
<meta name="stripe-key" content="{{ config('services.stripe.key') }}"> - If you want to use the Vue components, add the
store.jsto yourresources/js/app.jsfile - Add Vue to your
package.jsonfile -"vue": "^2.6.12" - Add the following routes to your
routes/web.phpfile:
/**
* Store Routes
*/
Route::group(['prefix' => 'api/'.config('seandowney.storecrud.route_prefix', 'store')], function () {
Route::post('country', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\ApiController@countryDelivery']);
Route::get('cart', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\ApiController@cartSummary']);
Route::delete('cart', '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\ApiController@clearCart');
Route::post('cart/items', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\ApiController@addItem']);
Route::delete('cart/items/{skuCode}', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\ApiController@removeItem']);
});
Route::group(['prefix' => config('seandowney.storecrud.route_prefix', 'store')], function () {
// handle the cart
Route::get('cart', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\CartController@index']);
Route::get('address', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\CartController@address']);
Route::post('address', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\CartController@storeAddress']);
Route::get('checkout', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\CartController@checkout']);
Route::post('pay', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\CartController@pay']);
Route::get('thankyou', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\CartController@thankyou']);
Route::get('/', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\StoreController@index']);
Route::get('{category}/{product}/{subs?}', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\StoreController@product'])
->where(['category' => '^((?!admin).)*$', 'product' => '^((?!admin).)*$', 'subs' => '.*']);
Route::get('{category}', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\StoreController@category'])
->where(['category' => '^((?!admin).)*$']);
});
- Add the following route to your
routes\api.phpfile:
/**
* Store Route for Stripe webhooks
*/
Route::group(['prefix' => config('seandowney.storecrud.route_prefix', 'store')], function () {
Route::post('complete', ['uses' => '\SeanDowney\BackpackStoreCrud\app\Http\Controllers\ApiController@completePurchase']);
});
- Add the webhook to your Stripe account for the
payment_intent.succeededevent
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
// TODO
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email sean@considerweb.com instead of using the issue tracker.
Credits
- Seán Downey - Lead Developer
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
seandowney/backpackstorecrud 适用场景与选型建议
seandowney/backpackstorecrud 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 69 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 07 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「shop」 「store」 「manage products」 「laravel backpack」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 seandowney/backpackstorecrud 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 seandowney/backpackstorecrud 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 seandowney/backpackstorecrud 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Forked from https://github.com/deltaaskii/lara-pdf-merger. Add condition if(!class_exists('TCPDF')) (depreciated in php 7.2) to foreach.
The library provides a flexible way to add role-based access control management to CakePHP 3.x
Admin Hub for GetCandy. A modern headless e-commerce solution for Laravel PHP framework.
Submodule for SilverShop which allows you to compare products in a table.
Product catalog for your Symfony2 applications.
统计信息
- 总下载量: 69
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-01