Download the PHP package heliip/laravel-encrypted-responses without Composer
On this page you can find all versions of the php package heliip/laravel-encrypted-responses. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heliip/laravel-encrypted-responses
More information about heliip/laravel-encrypted-responses
Files in heliip/laravel-encrypted-responses
Package laravel-encrypted-responses
Short Description Laravel middleware to encrypt API responses using Laravel Crypt with optional compressed payloads.
License MIT
Homepage https://github.com/heliip/laravel-encrypted-responses
Informations about the package laravel-encrypted-responses
Heliip Laravel Encrypted Responses
Laravel package for encrypting API responses with Laravel's Crypt service.
Requirements
- PHP 8.3 or higher
- Laravel 13
- PHP extensions:
json,zlib
Installation
Usage
Enable automatic registration for the api middleware group:
Or register the middleware manually in bootstrap/app.php:
For specific routes, use the middleware alias:
Configuration
The configuration file is published to config/encrypted-responses.php.
Common environment variables:
ENCRYPT_RESPONSES_OUTPUT=raw returns the encrypted string as the response body.
ENCRYPT_RESPONSES_OUTPUT=json returns:
Payload Format
With ENCRYPT_RESPONSES_JSON_ENCODED_COMPRESSED_PAYLOAD=true, payloads are encoded as:
Exclusions
The middleware skips:
- Binary file responses
- Streamed responses
- Empty responses such as
204and304 - Excluded paths and route names
- Excluded content types such as images, video, PDF, and ZIP
To skip encryption for a single request:
Manual Encryption
Testing
License
The MIT License (MIT). See LICENSE.md.
All versions of laravel-encrypted-responses with dependencies
ext-json Version *
ext-zlib Version *
illuminate/contracts Version ^13.0
illuminate/encryption Version ^13.0
illuminate/http Version ^13.0
illuminate/support Version ^13.0
symfony/http-foundation Version ^7.4|^8.0