shiftechafrica/laravel-multiple-guards
Composer 安装命令:
composer require shiftechafrica/laravel-multiple-guards
包简介
This library helps one to handle multiple guards. Read through the read me.
README 文档
README
Introduction
This library helps one to handle multiple guards. Read through to understand how to use it.
Installing
The recommended way to install laravel-multiple-guards is through Composer.
# Install package via composer
composer require shiftechafrica/laravel-multiple-guards
Next, run the Composer command to install the latest stable version of shiftechafrica/laravel-multiple-guards:
# Update package via composer
composer update shiftechafrica/laravel-multiple-guards --lock
After installing, the package will be auto discovered, But if need you may run:
# run for auto discovery <-- If the package is not detected automatically -->
composer dump-autoload
Then run this, to get the config/laravel-multiple-guards.php for your own configurations:
# run this to get the configuration file at config/laravel-multiple-guards.php <-- read through it --> php artisan vendor:publish --provider="LaravelMultipleGuards\LaravelMultipleGuardsServiceProvider"
A config/laravel-multiple-guards.php file will be created, follow the example below to define your guards.
# set all the guards to use within the system SYSTEM_GUARDS=admin,web
Usage
Follow the steps below on how to use the laravel-multiple-guards:
How to use the Library
How to use the guards within your controller...
class HomeController extends Controller { use FindGuard; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware($this->setGuardMiddleware()); //@todo this sets the middleware automatically i.e auth, auth:admin that you have defined in the config/auth.php } /** * Show the application dashboard. * * @return Renderable */ public function index() { return view('home'); } /** * get authenticated user */ public function getUser() { return $this->findGuardType()->user(); } /** * logout user * @return RedirectResponse */ public function logout() { $this->findGuardType()->logout(); return redirect()->route('login'); } } /** * How to get the guard name * authorized */ return $this->findGuardType(true); //@todo this returns the guard name i.e web , admin
Version Guidance
| Version | Status | Packagist | Namespace | Repo |
|---|---|---|---|---|
| 1.x | EOL | shiftechafrica/laravel-multiple-guards |
LaravelMultipleGuards |
v1.1.9 |
| 2.x | Latest | shiftechafrica/laravel-multiple-guards |
LaravelMultipleGuards |
v2.0.1 |
Security Vulnerabilities
For any security vulnerabilities, please email to Support.
License
This package is open-source, licensed under the MIT License.
shiftechafrica/laravel-multiple-guards 适用场景与选型建议
shiftechafrica/laravel-multiple-guards 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 79 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 07 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Authentication」 「multiple」 「laravel」 「guards」 「livewire」 「multiple guards」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 shiftechafrica/laravel-multiple-guards 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shiftechafrica/laravel-multiple-guards 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 shiftechafrica/laravel-multiple-guards 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
GraphQL authentication for your headless Craft CMS applications.
Extensions for laravel's database abstraction layer
Laravel middleware to restrict a site or specific routes using HTTP basic authentication
Extension of Magento2 Sales Rule to allow multiple coupon usage.
Email Toolkit Plugin for CakePHP
统计信息
- 总下载量: 79
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-09