Integrating with Laravel API
Using authaction-php-sdk
Section titled “Using authaction-php-sdk”composer require authaction/authaction-php-sdkuse AuthAction\AuthAction;
$this->app->singleton(AuthAction::class, fn () => new AuthAction(config('authaction.domain'), config('authaction.audience')));->withMiddleware(function (Middleware $middleware) { $middleware->alias(['auth.jwt' => \AuthAction\Middleware\LaravelMiddleware::class]);})Route::middleware('auth.jwt')->get('/protected', function (Request $request) { $user = $request->get('authaction.user'); // decoded JWT payload return ['sub' => $user->sub];});Full SDK reference: github.com/authaction/authaction-php-sdk