GithubHelp home page GithubHelp logo

zbage / laravel_api_init Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guaosi/laravel_api_init

0.0 2.0 0.0 1.4 MB

将Laravel框架进行扩展配置处理,让其在开发API时更得心应手。

PHP 97.36% Vue 0.44% HTML 2.21%

laravel_api_init's Introduction

将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 [email protected]: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

laravel_api_init's People

Contributors

guaosi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.