kablanfatih/encryption
A Laravel package that provides a simple, consistent API for encrypting and decrypting application data, wrapping Laravel's built-in encrypter so you can secure sensitive values, tokens, and stored fields while keeping key handling in config.
The 1.1.0 release widens framework support to Laravel 5.x, 6.x, and 7.x. That single fact drives most of what follows: this is a compatibility-oriented release, not a feature release, so the first task is to confirm where you sit in that matrix before writing any integration code.
Start here:
composer show laravel/framework and php -v. Laravel 5.x runs on PHP 5.6–7.2 (5.5+ prefers 7.1), Laravel 6 and 7 require PHP 7.2+ (7.x recommends 7.4). If you are on Laravel 5, verify you are not relying on 6/7-only helpers.composer.json, specifically the illuminate/* and php constraints. A multi-version release usually ships union constraints (^5.5|^6.0|^7.0) with orchestra/testbench branches per version — that file tells you what the maintainer actually tests.src/*ServiceProvider.php). This is where package config, bindings, and any version-conditional register()/boot() logic lives. On 1.1.0 this is the most likely place for version_compare or method_exists shims.php artisan vendor:publish --provider="Vendor\\Package\\PackageServiceProvider". Diff the published file against the package's source copy so future upgrades do not silently overwrite your tuning.If you are building or maintaining an application that must span these versions (common for agencies with several long-lived client apps), treat 1.1.0 as the release that lets you share one dependency across your whole portfolio — and set up CI accordingly before you rely on it.
Pin per application, not per machine. Use explicit constraints in each app's composer.json rather than a global resolution:
"require": {
"php": "^7.2",
"laravel/framework": "^6.0",
"vendor/package": "^1.1"
}
Then composer update vendor/package --with-dependencies in one app at a time. Avoid composer update wholesale when you span 5/6/7, or you will resolve different transitive versions per project and lose reproducibility.
Abstract framework-version differences at the edges. Laravel 5 → 6 introduced semantic versioning and split several components; 6 → 7 changed route caching behaviour, getRouteKeyName defaults, and session/queue internals. Keep those differences in your own service layer rather than in package usage:
// app/Support/Laravel.php
class Laravel
{
public static function isV5(): bool
{
return version_compare(app()->version(), '6.0.0', '<');
}
}
Lockfile discipline across a version matrix. If you maintain one package consumer per Laravel version, commit composer.lock for each and treat them as separate artifacts. This is the single highest-value habit when a package claims 5/6/7 support — it makes "works on my machine" impossible to hide.
Container binding over static calls. The package's facade (if any) is convenient in controllers but awkward in queued jobs and Artisan commands that boot before the app is fully resolved. Bind the underlying class in a provider and inject it:
public function register()
{
$this->app->singleton(PackageClient::class, function ($app) {
return new PackageClient($app['config']['package']);
});
}
Test against the real matrix. With orchestra/testbench, run separate CI jobs per framework version:
strategy:
matrix:
laravel: [5.8, 6.20, 7.30]
php: [7.2, 7.4]
exclude:
- laravel: 5.8
php: 7.4
This is the pattern the 1.1.0 change implicitly asks you to adopt — the release claims support, but only your matrix proves it for your usage.
Upgrade path pattern. For an app moving 5 → 6 → 7, upgrade the package to ^1.1 after the framework bump and after laravel-shift-style automated fixes, then re-run the package's own test suite as a smoke test before your application suite. If the package ships tests, run them from vendor/ via a thin testbench harness; it is the fastest compatibility oracle you have.
composer.json constraints before believing it, and check whether all three versions are exercised in CI or only the newest.@suppress-style compromises — missing return types, array instead of typed properties — that exist purely for 5.x compatibility.composer why-not laravel/framework 5.7 rather than guessing.php artisan config:cache and route:cache behave differently across these versions. Clear caches (php artisan optimize:clear on 6/7; config:clear + route:clear on 5.x) after deploying a package upgrade before concluding the upgrade broke something.vendor:publish will not overwrite existing config by default; new keys introduced in 1.1.0 will be null in your app until you re-publish with --force into a scratch directory and diff. Do that diff, then merge by hand.Log::debug() inside the service provider's boot() to confirm it registers at all; providers can no-op silently on 5.x when they rely on 6/7-only methods.^1.1 rather than *, and read the 2.0 changelog early so that an eventual drop of Laravel 5 does not force an emergency rewrite.How can I help you explore Laravel packages today?