xgbnl/laravel-guard

Laravel守卫扩展包

This package's canonical repository appears to be gone and the package has been frozen as a result.

dev-main 2023-03-14 01:11 UTC

This package is auto-updated.

Last update: 2024-11-14 05:04:11 UTC


README

Bearer Auth

环境要求:php8.1 、redis、ext-http、ext-redis、ext-openssl、pecl-http

引入包

composer require xgbnl/laravel-guard

发布配置文件

php artisan guard:install

简单使用

  1. 编辑 .env,配置 redis
REDIS_HOST=redis
REDIS_PASSWORD=123456
REDIS_PORT=6379
  • 前端使用

记得请求头要这样写:

request.headers['Authorization'] = 'Bearer' + ' ' + getToken() // getToken()是你定义的获取token方法

LICENSE

基于 MIT 开源