laravel/workos
Laravel utilities used by Laravel starter kits to integrate WorkOS AuthKit. Provides the glue for authentication flows and configuration so you can add WorkOS-powered login to a Laravel app quickly and consistently.
workos/workos-php) as a dependency.WorkOSAuthService).EnsureWorkOSUser).workos.enabled).department) to sync from WorkOS?workos/workos-php (likely auto-installed as a dependency).workos_user_id).composer require laravel/workos.php artisan vendor:publish --provider="Laravel\WorkOS\WorkOSServiceProvider"..env:
WORKOS_TENANT_ID=your_tenant_id
WORKOS_SECRET_KEY=your_secret_key
WORKOS_ENABLED=true
app/Http/Kernel.php:
'web' => [\Laravel\WorkOS\Http\Middleware\EnsureWorkOSUser::class],
LoginController to use WorkOS OAuth.User model to include WorkOS sync methods.workos/workos-php is compatible with WorkOS’s latest API.laravel/workos and workos/workos-php for updates.WORKOS_ENABLED) may need toggling for testing.WorkOS::log(function ($message) {
\Log::info('WorkOS: ' . $message);
});
public function handle($request, Closure $next) {
try {
return $next($request);
} catch (WorkOSException $e) {
auth()->logout();
return redirect()->route('login.local');
}
}
workos_user_* Redis keys).tenant_id in WorkOS config).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| WorkOS API downtime | Auth failures | Local auth fallback + alerts |
| WorkOS rate limiting | Slow logins | C |
How can I help you explore Laravel packages today?