# wechatmall **Repository Path**: huimingdeng/wechatmall ## Basic Information - **Project Name**: wechatmall - **Description**: 微信商城开发案例,Laravel - **Primary Language**: PHP - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 9 - **Forks**: 1 - **Created**: 2019-01-30 - **Last Updated**: 2025-08-20 ## Categories & Tags **Categories**: ecommerce **Tags**: PHP ## README # wechatmall [](https://gitee.com/huimingdeng/wechatmall) 下载测试仓库 git clone git@gitee.com:huimingdeng/wechatmall.git git clone https://gitee.com:huimingdeng/wechatmaill.git //当前克隆如果pull文件,则需要的账号密码为 gitee git pull origin master git push origin master [](https://gitee.com/huimingdeng/wechatmall/stargazers) [](https://gitee.com/huimingdeng/wechatmall/members) #### 介绍 Laravel 项目实战——微信商城案例。该项目目前阶段开发将仅用于学习用途,非商业用途。 #### 软件架构 软件架构说明--laravel框架开发微信商城。命令`php artisan list` 查看项目使用框架的版本:`Laravel5.7.26` #### 安装教程 1. `git clone https://gitee.com/huimingdeng/wechatmal.git` 或直接下载 `ZIP` 文件解压安装。 2. 项目需求 `PHP7.1+` 框架 `Laravel5.7.26` 3. 环境低于 `PHP7.1` 版本则项目的 `laravel` 框架无法运行,当然您可以重构项目 #### 使用说明 1. 微信公众号必须有一个(个人可以使用测试号测试) 2. 需要一台带公网IP的服务器,可以购买一台便宜的[腾讯云](https://cloud.tencent.com/ "腾讯云")学生机或 [阿里云](https://www.aliyun.com/ "阿里云")、[青云](https://www.qingcloud.com/ "青云")等云服务器。 3. 目前不支持 composer 安装,若需要支持,则需要在 composer 镜像市场发布,发布教程看 GitHub 上的笔记。 #### 工具 #### 1. `Tinker` 数据交换平台 `Laravel` 自带。 eg. `new App\User` 查看帮助 1. 创建测试数据 `factory(App\User::class,15)->create()` P.S. 开发过程创建迁移数据,当前 `laravel` 版本对应的数据库要 `5.7.7` 以上,否则迁移失败,本地开发因数据库版本为 `5.5.53` 导致错误, `phpStudy2018` 升级 [`mysql5.7+`](https://github.com/huimingdeng/hello-world/tree/master/MySQL-learn "mysql5.7.17") #### API 开发与测试 #### 本地安装 `PostMan` 进行测试 `http://wechatmall.com/api/index` 返回信息 `api` // 测试 API, api 路由需要携带前缀 Route::get('index', function(){ return 'api'; });  构建特性 `trait` 在存放公用方法,相当于多继承作用。 根据控器其特性构建,`Laravel` 框架使用较多。 `php artisan make:resource UserResource` 创建资源 #### 资源管理器对应操作方法参考 #### 动作:对应的是HTTP请求的action 方式;URI: 为资源路由URL中请求的路径动作;行为:对应资源控制器中的动作方法
| 动作 | URI | 行为 | 路由名称 |
|---|---|---|---|
| `GET` | `/photos` | index | photos.index |
| `GET` | `/photos/create` | create | photos.create |
| `POST` | `/photos` | store | photos.store |
| `GET` | `/photos/{photo}` | show | photos.show |
| `GET` | `/photos/{photo}/edit` | edit | photos.edit |
| `PUT/PATCH` | `/photos/{photo}` | update | photos.update |
| `DELETE` | `/photos/{photo}` | destroy | photos.destroy |