承接 birdcar/authkit-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

birdcar/authkit-laravel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require birdcar/authkit-laravel

包简介

Laravel integration for WorkOS AuthKit

README 文档

README

Latest Version on Packagist PHP Version Laravel Version License

Drop-in WorkOS AuthKit integration for Laravel. Guards, middleware, Blade directives, Livewire widgets, webhook sync, and an interactive install wizard -- everything wired up so you can go from composer require to working authentication in about 15 minutes.

Installation

composer require birdcar/authkit-laravel

Run the install wizard:

php artisan workos:install

Add your WorkOS Dashboard credentials to .env:

WORKOS_API_KEY=sk_live_...
WORKOS_CLIENT_ID=client_...
WORKOS_REDIRECT_URI=https://your-app.test/auth/callback

The package auto-registers its service provider and WorkOS facade via Laravel's package discovery. See Installation for migration guides, custom guard names, and publishing config.

Quick start

The package registers a workos auth guard and sets up /auth/login, /auth/callback, and /auth/logout routes automatically:

// routes/web.php
Route::middleware('workos.auth')->group(function () {
    Route::get('/dashboard', fn () => view('dashboard'));
});

Check roles and permissions in routes or Blade:

Route::middleware(['workos.auth', 'workos.role:admin'])->group(/* ... */);
Route::middleware(['workos.auth', 'workos.permission:posts:write'])->group(/* ... */);
@workosRole('admin')
    <a href="/admin">Admin Panel</a>
@endworkosRole

@workosPermission('posts:write')
    <button>New Post</button>
@endworkosPermission

See Authentication and Authorization for the full API.

Testing

use WorkOS\AuthKit\Facades\WorkOS;

it('requires admin role', function () {
    $user = User::factory()->create();

    WorkOS::actingAs($user, roles: ['admin']);
    $this->get('/admin')->assertOk();

    WorkOS::actingAs($user, roles: ['member']);
    $this->get('/admin')->assertForbidden();
});

See Testing for WorkOS::fake(), builder methods, audit assertions, and the InteractsWithWorkOS trait.

Documentation

  • Installation -- Setup, migration from existing auth, publishing config
  • Authentication -- Guard, sessions, login/callback/logout, impersonation
  • Authorization -- Roles, permissions, FGA, feature flags, middleware, Blade directives
  • Organizations -- Multi-org, switching, invitations, domain verification
  • Events & Webhooks -- Event routing, Events API polling worker
  • Webhooks -- Real-time webhook ingestion, event handling, sync listeners
  • Widgets -- Livewire components for user management, admin portal, etc.
  • Testing -- WorkOS::fake(), actingAs(), assertions
  • Audit Logging -- WorkOS Audit Logs integration
  • Commands -- Artisan command reference
  • Configuration -- Complete config reference

Requirements

  • PHP 8.3+
  • Laravel 11 or 12
  • WorkOS PHP SDK ^5.0
  • Livewire ^4.0 (optional, for widget components only)

License

MIT. See LICENSE for details.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固