承接 fredbradley/google-storage-user-photos-encrypter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fredbradley/google-storage-user-photos-encrypter

最新稳定版本:1.0.1

Composer 安装命令:

composer require fredbradley/google-storage-user-photos-encrypter

包简介

Customer Encrypter for user photos stored in Google Storage for Laravel applications.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A custom encrypter for user photos stored in Google Cloud Storage, for the purpose of being able to encrypt the documents into Google Storage, but use them across multiple Laravel applications with the same encryption keys.

Installation

You can install the package via composer:

composer require fredbradley/google-storage-user-photos-encrypter

You can publish the config file with, but it's not necessary to:

php artisan vendor:publish --tag="google-storage-user-photos-encrypter-config"

You will need to add your USER_PHOTOS_ENCRYPTION_KEY and you may want to override the default cipher by adding these two lines to your .env file:

USER_PHOTOS_ENCRYPTION_KEY=base64:your-base64-encoded-key-here
USER_PHOTOS_ENCRYPTION_CIPHER=AES-256-CBC

Usage

As a Facade:

// A check to see whether encrypter status is on. (Just add `USER_PHOTOS_ENCRYPTION_STATUS=on` to your .env to enable it)
if (\FredBradley\GoogleStorageUserPhotosEncrypter\Facades\GoogleStorageUserPhotosEncrypter::active()) {
// returns a bool 
}

// Encrypt a value
$encryptedString = \FredBradley\GoogleStorageUserPhotosEncrypter\Facades\GoogleStorageUserPhotosEncrypter::encrypt($string);

// Decrypt a value  
$string = \FredBradley\GoogleStorageUserPhotosEncrypter\Facades\GoogleStorageUserPhotosEncrypter::decrypt($encryptedString);

Via Dependency Injection:

public function handle(\FredBradley\GoogleStorageUserPhotosEncrypter\GoogleStorageUserPhotosEncrypter $encrypter)
{
    $string = "test string";
    
    if ($encrypter::active()) {
       
        // Encrypt a value
        $encryptedString = $encrypter->encrypt($string);

        // Decrypt a value  
        $string = $encrypter->decrypt($encryptedString);
    }
    
    return $string;
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-24