hans-thomas/sphinx 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hans-thomas/sphinx

最新稳定版本:v2.2.1

Composer 安装命令:

composer require hans-thomas/sphinx

包简介

JSON web token driver for laravel

README 文档

README

sphinx Logo

codecov GitHub Workflow Status GitHub top language GitHub release (latest by date) StyleCi

Sphinx is a feature reach Jwt-based authentication system that make zero queries to database during authorization.

  • Customizable
  • Integration support with Horus
  • Based on Jwt
  • Two layers of encryption
  • Refresh token support
  • Logged-in users in one account limitation

Installation

Install the package via composer.

composer require hans-thomas/sphinx 

Then, publish config file.

php artisan vendor:publish --tag sphinx-config 

Setting up

Model

First, use Hans\Sphinx\Traits\SphinxTrait trait on your model and then implement the abstract methods. Next, inside your model, make sure to call the hooks method in your booted method.

use SphinxTrait, SphinxTrait { SphinxTrait::hooks as private sphinxHooks; } protected static function booted() { self::sphinxHooks(); } 

Auth configuration

First of all, define the provider.

'providers' => [ // ... 'sphinxUsers' => [ 'driver' => 'sphinx', 'model' => App\Models\User::class, ], // ... ], 

Then, add your guard.

'guards' => [ // ... 'jwt' => [ 'driver' => 'sphinxJwt', 'provider' => 'sphinxUsers', ], // ... ], 

And finally, you can set the jwt guard as default.

'defaults' => [ // ... 'guard' => 'jwt', // ... ], 

All sets. enjoy!

Read more about Sphinx in documentation website.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request ❤️

Support

统计信息

  • 总下载量: 2.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固