将Laravel框架进行扩展配置处理,让其在开发API时更得心应手。
Go to file
dependabot[bot] d69bbd372e
Bump symfony/http-kernel from 4.2.3 to 4.4.50
Bumps [symfony/http-kernel](https://github.com/symfony/http-kernel) from 4.2.3 to 4.4.50.
- [Release notes](https://github.com/symfony/http-kernel/releases)
- [Changelog](https://github.com/symfony/http-kernel/blob/6.2/CHANGELOG.md)
- [Commits](https://github.com/symfony/http-kernel/compare/v4.2.3...v4.4.50)

---
updated-dependencies:
- dependency-name: symfony/http-kernel
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-02 05:25:02 +00:00
app 增加一些备注 2019-03-24 13:20:34 +08:00
bootstrap finish basic 2019-03-01 14:08:34 +08:00
config update readme 2019-03-01 15:27:46 +08:00
database add migrate and seed 2019-03-01 14:50:28 +08:00
public finish basic 2019-03-01 14:08:34 +08:00
resources finish basic 2019-03-01 14:08:34 +08:00
routes 删除一些无用if判断 2019-03-23 09:39:05 +08:00
storage finish basic 2019-03-01 14:08:34 +08:00
tests finish basic 2019-03-01 14:08:34 +08:00
.editorconfig finish basic 2019-03-01 14:08:34 +08:00
.env.example finish basic 2019-03-01 14:08:34 +08:00
.gitattributes finish basic 2019-03-01 14:08:34 +08:00
.gitignore delete .idea 2019-03-24 13:25:40 +08:00
LICENSE Create LICENSE 2020-01-11 15:10:42 +08:00
artisan finish basic 2019-03-01 14:08:34 +08:00
composer.json finish basic 2019-03-01 14:08:34 +08:00
composer.lock Bump symfony/http-kernel from 4.2.3 to 4.4.50 2023-02-02 05:25:02 +00:00
package.json finish basic 2019-03-01 14:08:34 +08:00
phpunit.xml finish basic 2019-03-01 14:08:34 +08:00
readme.md update readme 2019-03-01 15:27:46 +08:00
server.php finish basic 2019-03-01 14:08:34 +08:00
webpack.mix.js finish basic 2019-03-01 14:08:34 +08:00

readme.md

将Laravel框架进行一些配置处理让其在开发API时更得心应手

来源

配置过程以及配置原理都来自我的博客:手摸手教你让Laravel开发Api更得心应手

这里是方便懒人下载,快速搭建,不需要再重新配置一遍。

目前使用的Laravel版本是5.7

实现功能

  • 解决跨域问题

  • 统一Response响应处理

  • Api-Resource资源返回

  • 使用Enum枚举

  • jwt-auth用户认证与无感知自动刷新

  • jwt-auth多角色认证不串号

  • 单一设备登陆

  • horizon管理异步队列

环境

程序 版本
PHP >= 7.1
MySQL >= 5.5
Redis >= 2.8

安装

1.先把项目克隆到本地

git clone git@github.com:guaosi/Laravel_api_init.git

2.打开项目目录,下载依赖扩展包

composer install

3.复制配置文件

cp .env.example .env

自行配置.env里的相关配置信息

4.生成APP_KEYJWT_SECRET

php artisan key:generate
php artisan jwt:secret

5.创建迁移

php artisan migrate

6.填充数据

php artisan db:seed

测试数据

users: guoasi1 12345678 guoasi2 12345678

admins: guaosi123 12345678 guaosi124 12345678