Skip to content

Commit

Permalink
Merge pull request #20 from CodeLieutenant/feat/change-namespace
Browse files Browse the repository at this point in the history
Change namespace
  • Loading branch information
CodeLieutenant authored Feb 27, 2024
2 parents e792950 + 45f1f28 commit cb71346
Show file tree
Hide file tree
Showing 73 changed files with 269 additions and 269 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ As long as you use default laravel encryption, you don't need to change anything
### Installing

```shell script
composer require brossquad/laravel-crypto
composer require codelieutenant/laravel-crypto
```

### Publishing config file

```shell script
php artisan vendor:publish --provider="BrosSquad\LaravelCrypto\ServiceProvider"
php artisan vendor:publish --provider="CodeLieutenant\LaravelCrypto\ServiceProvider"
```

### Replacing Laravel's EncryptionServiceProvider with LaravelCrypto's ServiceProvider
Expand All @@ -35,13 +35,13 @@ In order to activate this package, you need to replace Laravel's `EncryptionServ
with `LaravelCryptoServiceProvider`.

In `config/app.php` replace `Illuminate\Encryption\EncryptionServiceProvider::class`
with `BrosSquad\LaravelCrypto\ServiceProvider::class`
with `CodeLieutenant\LaravelCrypto\ServiceProvider::class`
Depending on the laravel version you are using, you can do it in two ways.

Laravel 9.0 and above:

```php
use BrosSquad\LaravelCrypto\ServiceProvider as LaravelCryptoServiceProvider;
use CodeLieutenant\LaravelCrypto\ServiceProvider as LaravelCryptoServiceProvider;
use Illuminate\Encryption\EncryptionServiceProvider as LaravelEncryptionServiceProvider;

// ...
Expand All @@ -60,7 +60,7 @@ use Illuminate\Encryption\EncryptionServiceProvider as LaravelEncryptionServiceP
Laravel 8.0:

```php
use BrosSquad\LaravelCrypto\ServiceProvider as LaravelCryptoServiceProvider;
use CodeLieutenant\LaravelCrypto\ServiceProvider as LaravelCryptoServiceProvider;

'providers' => [
// ...
Expand Down
18 changes: 9 additions & 9 deletions README.old.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $ composer require brossquad/laravel-crypto
### Publishing config file

```shell script
php artisan vendor:publish --provider="BrosSquad\LaravelCrypto\HashingServiceProvider"
php artisan vendor:publish --provider="CodeLieutenant\LaravelCrypto\HashingServiceProvider"
```

### Generating EdDSA private and public key
Expand All @@ -78,7 +78,7 @@ $ php artisan crypto:keys
#### Base64 Encoding

```php
use BrosSquad\LaravelCrypto\Support\Base64;
use CodeLieutenant\LaravelCrypto\Support\Base64;

$binaryData = random_bytes(32);

Expand Down Expand Up @@ -134,7 +134,7 @@ $base64Length = Base64::encodedLength($bufferLength, $hasPadding);
### Generating random data

```php
use BrosSquad\LaravelCrypto\Support\Random;
use CodeLieutenant\LaravelCrypto\Support\Random;

// Generate random string
$randomString = Random::string(60); // Generates random string base64 url encoded with no padding
Expand All @@ -155,7 +155,7 @@ Laravel crypto library uses the latest and best hashing algorithms. (Blake2b)
```php
namespace App\Services;

use BrosSquad\LaravelCrypto\Facades\Hashing;
use CodeLieutenant\LaravelCrypto\Facades\Hashing;

class Service
{
Expand Down Expand Up @@ -199,7 +199,7 @@ class Service
```php
namespace App\Services;

use \BrosSquad\LaravelCrypto\Contracts\Hashing;
use \CodeLieutenant\LaravelCrypto\Contracts\Hashing;

class Service
{
Expand Down Expand Up @@ -263,7 +263,7 @@ Read more on [HMAC](https://en.wikipedia.org/wiki/HMAC)

namespace App\Service;

use BrosSquad\LaravelCrypto\Facades\Sign;
use CodeLieutenant\LaravelCrypto\Facades\Sign;

class Service
{
Expand Down Expand Up @@ -297,7 +297,7 @@ class Service
```php
namespace App\Service;

use BrosSquad\LaravelCrypto\Contracts\Signing;
use CodeLieutenant\LaravelCrypto\Contracts\Signing;

class Service
{
Expand Down Expand Up @@ -346,7 +346,7 @@ Public key signing uses state of the art in public key cryptography -> EdDSA or

namespace App\Service;

use BrosSquad\LaravelCrypto\Facades\EdDSA;
use CodeLieutenant\LaravelCrypto\Facades\EdDSA;

class Service
{
Expand Down Expand Up @@ -381,7 +381,7 @@ class Service
```php
namespace App\Service;

use BrosSquad\LaravelCrypto\Contracts\PublicKeySigning;
use CodeLieutenant\LaravelCrypto\Contracts\PublicKeySigning;

class Service
{
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/Base64Bench.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);

namespace BrosSquad\LaravelCrypto\Benchmarks;
namespace CodeLieutenant\LaravelCrypto\Benchmarks;

use BrosSquad\LaravelCrypto\Support\Base64;
use CodeLieutenant\LaravelCrypto\Support\Base64;
use Generator;
use PhpBench\Attributes\Groups;
use PhpBench\Attributes\ParamProviders;
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/DecryptionBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace BrosSquad\LaravelCrypto\Benchmarks;
namespace CodeLieutenant\LaravelCrypto\Benchmarks;

use BrosSquad\LaravelCrypto\Encryption\AesGcm256Encryptor;
use BrosSquad\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor;
use CodeLieutenant\LaravelCrypto\Encryption\AesGcm256Encryptor;
use CodeLieutenant\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor;
use Illuminate\Encryption\Encrypter;

class DecryptionBench
Expand Down
16 changes: 8 additions & 8 deletions benchmarks/EncryptionBench.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);

namespace BrosSquad\LaravelCrypto\Benchmarks;

use BrosSquad\LaravelCrypto\Encoder\IgbinaryEncoder;
use BrosSquad\LaravelCrypto\Encoder\JsonEncoder;
use BrosSquad\LaravelCrypto\Encoder\PhpEncoder;
use BrosSquad\LaravelCrypto\Encryption\AesGcm256Encryptor;
use BrosSquad\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor;
use BrosSquad\LaravelCrypto\Support\Random;
namespace CodeLieutenant\LaravelCrypto\Benchmarks;

use CodeLieutenant\LaravelCrypto\Encoder\IgbinaryEncoder;
use CodeLieutenant\LaravelCrypto\Encoder\JsonEncoder;
use CodeLieutenant\LaravelCrypto\Encoder\PhpEncoder;
use CodeLieutenant\LaravelCrypto\Encryption\AesGcm256Encryptor;
use CodeLieutenant\LaravelCrypto\Encryption\XChaCha20Poly1305Encryptor;
use CodeLieutenant\LaravelCrypto\Support\Random;
use Generator;
use Illuminate\Encryption\Encrypter;
use Illuminate\Support\Js;
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/KeyLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace BrosSquad\LaravelCrypto\Benchmarks;
namespace CodeLieutenant\LaravelCrypto\Benchmarks;

use BrosSquad\LaravelCrypto\Keys\Loader;
use CodeLieutenant\LaravelCrypto\Keys\Loader;

class KeyLoader implements Loader
{
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "brossquad/laravel-crypto",
"name": "codelieutenant/laravel-crypto",
"description": "Laravel Crypto is a package that provides a simple and easy to use API for encrypting, decrypting, hashing, and signing data using the latest PHP and Laravel features.",
"type": "library",
"license": "MIT",
Expand Down Expand Up @@ -34,21 +34,20 @@
"illuminate/support": "^8|^9|^10"
},
"require-dev": {
"brianium/paratest": "^7.3",
"orchestra/testbench": "^8.21",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.3",
"phpbench/phpbench": "^1.2"
},
"autoload": {
"psr-4": {
"BrosSquad\\LaravelCrypto\\": "src/"
"CodeLieutenant\\LaravelCrypto\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"BrosSquad\\LaravelCrypto\\Tests\\": "tests/",
"BrosSquad\\LaravelCrypto\\Benchmarks\\": "benchmarks/",
"CodeLieutenant\\LaravelCrypto\\Tests\\": "tests/",
"CodeLieutenant\\LaravelCrypto\\Benchmarks\\": "benchmarks/",
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
Expand All @@ -60,6 +59,7 @@
"ext-igbinary": "Required for Igbinary Serializer"
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
Expand Down
Loading

0 comments on commit cb71346

Please sign in to comment.