catlabinteractive / laravel-catlab-accounts
Oauth-Openid client for the catlab authentication api for Ll
Package info
github.com/CatLabInteractive/laravel-catlab-accounts
pkg:composer/catlabinteractive/laravel-catlab-accounts
Requires
- php: >=8.1
- socialiteproviders/manager: ^4.8
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- v4.6.0
- v4.5.0
- v4.4.0
- v4.3.0
- v4.2.0
- v4.1.0
- v4.0.2
- v4.0.1
- v4.0.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- dev-feature/mail-attachments
- dev-claude/project-thread-it3ns3
- dev-claude/project-thread-fr7f8r
- dev-feature/refund-order
- dev-chore/laravel-12-support
- dev-security/single-use-account-link
- dev-security/orders-mail-client-credentials
- dev-fix/http-timeouts
- dev-fix/order-read-client-credentials
This package is auto-updated.
Last update: 2026-12-01 13:53:35 UTC
README
Installation
- Add to your app config providers:
\CatLab\Accounts\Client\CatLabAccountsServiceProvider::class,
\SocialiteProviders\Manager\ServiceProvider::class,
- Add to aliases:
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
- Add to your (web)routes:
\CatLab\Accounts\Client\Controllers\LoginController::setRoutes();
- Add to EventServiceProvider
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
CatLabExtendSocialite::class
],
];
Mail with attachments
ApiClient::sendEmail takes a fifth parameter with the files to send:
$client->sendEmail($subject, $html, $target, $fromName, [ [ 'filename' => 'grote-herfstquiz.ics', 'contentType' => 'text/calendar', 'content' => $calendar, // the raw file content ], ]);
The library does the base64 step and posts a JSON body. Accounts allows at
most 3 attachments and 256 KB together, and only text/calendar with a
filename that ends in .ics. For anything else accounts answers 400 and
sends no mail, and Guzzle throws a ClientException. The caller decides
whether to send the mail again without the file. A call without attachments
sends the same form post as version 4.5.0.
Configuration
config/services.php reads these environment variables:
CATLAB_API: base url of the accounts server (defaulthttps://accounts.catlab.eu/).CATLAB_CLIENT_ID/CATLAB_CLIENT_SECRET: the product's OAuth2 client credentials. Required. Besides the login flow they authenticate the product-level API calls inApiClient(createOrder,sendEmail,getOrder,refundOrder,findOrCreateUser,cancelOrder), which use HTTP Basicclient_id:client_secretinstead of the user's access token. Accounts does not accept a user token on those routes, soApiClientthrows aLogicExceptionwhen they are missing.