Download the PHP package preprio/laravel-rest-sdk without Composer
On this page you can find all versions of the php package preprio/laravel-rest-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-rest-sdk
Laravel provider for the Prepr REST API
This Laravel package is a provider for the Prepr REST API.
Basics
- The SDK on GitHub
- Compatible with Laravel
v8x,v9x,v10x,v11x,v12x. - Requires
GuzzleHttp ^7.3 or ^8.0, and for version 3.0 and above PHP 8.x is required.
Installation
You can install the Provider as a composer package.
For Laravel v10x, v11x and Laravel v12x
For Laravel v9x
Publish config
Publish prepr.php config
Set up your .env file configuration
You can set the default configuration in your .env file of you Laravel project.
Laravel local caching
To make use of the caching feature of Laravel, add the following parameters to your .env file.
Optional options
Making your first request
Let's start with getting all content items from your Prepr Environment.
To get a single content item, pass the Id to the request.
Optional path parameters
Use {param?} for optional route segments (similar to Laravel route syntax). When the value is null or the key is missing, the segment is omitted from the path. Required placeholders ({param}) log a warning when the value is missing or null, and the path is normalized (no trailing slashes).
An empty string ('') is treated as a provided value, not as missing.
Override the AccessToken in a request
The authorization can also be set for one specific request ->url('url')->authorization('token').
Override the timeout in a request
The default timeout comes from PREPR_TIMEOUT (or config/prepr.php). You can override it for a single request:
Timeouts and connection errors
Connection errors are caught by the SDK. You can handle them like other API errors with getStatusCode() and getResponse(), without try/catch.
A timeout returns status 504:
Other connection problems (DNS, connection refused) return status 502:
Autopaging
Create, Update & Destroy
Post
Put (Update)
Patch (Update)
Delete
Multipart/Chunk upload
-
Option 1
- Option 2
Debug
For debug you can use getRawResponse()
All versions of laravel-rest-sdk with dependencies
guzzlehttp/guzzle Version ^7.3|^8.0
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0