一.介绍
beikeshop跨境电商独立站最新版V1.6.0源码
多商户 多商家 多语言 多币结算
本博主亲测搭建代码全开源质量相对来说很稳定的
二.服务器环境
系统:CentOS、
环境:PHP7.4+ Nginx 1.21 + MySQL 5.6
常见插件:fileinfo ; redis
三.系统效果图片(图片仅测试参考,无实际运营)
后端beike/AdminApi/Brand.php控制器代码:
<?php
/**
* BrandController.php
*
* @copyright 2023 beikeshop.com - All Rights Reserved
* @link https://beikeshop.com
* @author Edward Yang <[email protected]>
* @created 2023-04-20 17:19:51
* @modified 2023-04-20 17:19:51
*/
namespace Beike\AdminAPI\Controllers;
use Beike\Models\Brand;
use Beike\Repositories\BrandRepo;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class BrandController
{
/**
* 显示品牌列表
* @param Request $request
* @return mixed
*/
public function index(Request $request)
{
$brands = BrandRepo::list($request->only('name', 'first', 'status'));
$data = [
'brands' => $brands,
];
return hook_filter('admin_api.brand.index.data', $data);
}
/**
* 创建品牌
*
* @param Request $request
* @param Brand $brand
* @return Brand
*/
public function show(Request $request, Brand $brand): Brand
{
return hook_filter('admin_api.brand.show.data', $brand);
}
/**
* 创建品牌
*
* @param Request $request
* @return JsonResponse
*/
public function store(Request $request): JsonResponse
{
$requestData = $request->all();
$data = [
'request_data' => $requestData,
];
hook_action('admin_api.brand.store.before', $data);
$brand = BrandRepo::create($requestData);
hook_action('admin_api.brand.store.after', ['brand' => $brand, 'request_data' => $requestData]);
return json_success(trans('common.created_success'), $brand);
}