podio-labs/podio-laravel
A Laravel integration for the Podio API, offering a service provider, configuration, and client wrapper to authenticate and work with Podio workspaces, apps, and items from your PHP applications.
Start by treating 0.5.0 as a compatibility release: the Laravel-facing facade API is unchanged, but the underlying token manager now returns Token objects from ensure() and refresh(). Check your composer.json first and move the client constraint to podio-labs/podio-client:^0.5.
Minimal setup:
composer require podio-labs/podio-client:^0.5
composer update podio-labs/podio-client
.env:
PODIO_CLIENT_ID=
PODIO_CLIENT_SECRET=
PODIO_REDIRECT_URI=
Podio facade alias manually.php artisan config:clear
config/podio.php, the package service provider, the Podio facade, and the token manager binding. Those are the integration points you will use day to day.A good first use case is the authentication callback: authenticate through Podio::authenticate(), persist the returned Token, then make one simple read call against Podio. Because Podio::authenticate() and Podio::token() still return Token, facade-only code should not need changes for 0.5.0.
Wrap Podio access in a small application service rather than calling the facade throughout controllers and views. A typical structure is:
PodioAccount or PodioToken model storing access token, refresh token, expiry, and the Laravel user/tenant it belongs to.PodioService that loads the correct token, authenticates the client for that request/job, and exposes domain methods such as getItem(), createItem(), or syncWorkspace().Podio::authenticate(), stores the returned Token, and redirects.ensure() or refresh() methods.For token lifecycle, persist the Token returned by the facade or token manager. Use Podio::token() when you need the current token, and use the token manager’s ensure() when you need a valid token before an outbound call. Since both ensure() and refresh() now return Token, update any code that previously expected an array, string, or boolean.
For multi-user or multi-tenant applications, resolve the token per request or job and authenticate the client at the start of that unit of work. Do not assume the client remains authenticated as the previous user, especially in queue workers or long-running processes.
For queued jobs, pass a token ID or account ID into the job, not the Token object itself. Reload the token inside the job, refresh it if needed, and then make the Podio call. This avoids serialization problems and stale credentials.
For testing, bind a fake token manager or fake the Podio facade in the container. Assert against Token instances where your code calls ensure() or refresh(), and keep facade-level tests focused on Podio::authenticate() and Podio::token().
ensure() and refresh() now return Token. Update type hints, assertions, mocks, and any code that destructured the old return value. Facade users are unaffected, but direct token manager users should treat this as a behavioral change.podio-labs/podio-client on ^0.5. If Composer resolves an older client, you can get confusing token manager behavior. Use composer show podio-labs/podio-client when debugging.Cache::lock() around refresh operations and refresh with a safety window before expiry.php artisan config:clear; otherwise you may debug against stale values.How can I help you explore Laravel packages today?