community-sdks / laravel-cloud-laravel
A simple Laravel wrapper for the Community SDKs Laravel Cloud PHP client.
Package info
github.com/community-sdks/laravel-cloud-laravel
pkg:composer/community-sdks/laravel-cloud-laravel
Requires
- php: ^8.3
- community-sdks/laravel-cloud-php: ^1.0.1
- illuminate/contracts: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.88
- orchestra/testbench: ^9.0 || ^10.0 || ^11.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.0 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A small Laravel wrapper for community-sdks/laravel-cloud-php. It registers the typed SDK client in Laravel's container and provides a facade.
This is a community-maintained project and is not an official Laravel package.
Requirements
- PHP 8.3+
- Laravel 11, 12, or 13
Installation
composer require community-sdks/laravel-cloud-laravel
Add your Laravel Cloud API token to .env:
LARAVEL_CLOUD_TOKEN=your-api-token
The service provider and facade alias are discovered automatically. To publish the optional configuration file:
php artisan vendor:publish --tag=laravel-cloud-config
Usage
Use the facade to access any service exposed by the underlying SDK:
use CommunitySDKs\LaravelCloud\DTO\Requests\Applications\ListApplicationsRequest; use CommunitySDKs\LaravelCloudLaravel\Facades\LaravelCloud; $applications = LaravelCloud::applications()->list( new ListApplicationsRequest(), );
Or inject the SDK client directly:
use CommunitySDKs\LaravelCloud\Client; final class ListCloudApplications { public function __construct(private Client $cloud) {} public function __invoke(): mixed { return $this->cloud->applications()->list(); } }
For request DTOs, response types, and supported endpoints, see the PHP SDK documentation.
Configuration
The wrapper supports these environment variables:
| Variable | Default |
|---|---|
LARAVEL_CLOUD_TOKEN |
required when resolving the client |
LARAVEL_CLOUD_BASE_URI |
https://cloud.laravel.com/api/ |
LARAVEL_CLOUD_TIMEOUT |
30 seconds |
LARAVEL_CLOUD_CONNECT_TIMEOUT |
10 seconds |
Testing
composer install composer check
License
MIT