Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedepart3d/laravel-source-encryption
Laravel 9 Source Code Encryption
https://github.com/thedepart3d/laravel-source-encryption
Last synced: 19 days ago
JSON representation
Laravel 9 Source Code Encryption
- Host: GitHub
- URL: https://github.com/thedepart3d/laravel-source-encryption
- Owner: theDepart3d
- License: mit
- Created: 2022-07-17T02:04:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-29T13:49:26.000Z (over 1 year ago)
- Last Synced: 2024-10-10T19:12:47.800Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 63.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![](logo-img-white.svg)
This package encrypts your php code with [phpBolt](https://phpbolt.com)
For Laravel 9*
* [Installation](#installation)
* [Usage](#usage)## Installation
### Step 1
You have to [install phpBolt](https://phpbolt.com/download-phpbolt/).### Step 2
Require the package with composer using the following command:
```bash
composer require thedepart3d/laravel-source-encryption
```
### Step 3
#### For Laravel
The service provider will automatically get registered. Or you may manually add the service provider in your `config/app.php` file:
```php
'providers' => [
// ...
\thedepart3d\LaravelSourceEncryption\EncryptServiceProvider::class,
];
```
### Step 4 (Optional)
You can publish the config file with this following command:
```bash
php artisan vendor:publish --provider="thedepart3d\LaravelSourceEncryption\EncryptServiceProvider" --tag=encryptionConfig
```## Usage
Open terminal in project root and run this command:
```bash
php artisan encrypt-source
```
This command encrypts files and directories in `config/source-encryption.php` file. Default values are `app`, `database`, `routes`, `config`.The default destination directory is `encrypted-source`. You can change it in `config/source-encryption.php` file.
Also the default encryption key length is `16`. You can change it in `config/source-encryption.php` file. `6` is the recommended key length.
This command has these optional options:
| Option | Description | Example |
|-------------|----------------------------------------------------------------------|-------------------------|
| source | Path(s) to encrypt | app,routes,public/a.php |
| destination | Destination directory | encrypted-source |
| key | Custom Encryption key | |
| keylength | Encryption key length | 16 |
| force | Force the operation to run when destination directory already exists | |### Usage Examples
| Command | Description |
|---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| `php artisan encrypt-source` | Encrypts with default source, destination and keylength. If the destination directory exists, asks for delete it. |
| `php artisan encrypt-source --force` | Encrypts with default source, destination and keylength. If the destination directory exists, deletes it. |
| `php artisan encrypt-source --source=app` | Encrypts `app` directory to the default destination with default keylength. |
| `php artisan encrypt-source --destination=encrypted-source` | Encrypts with default source and key length to `encrypted-source` directory. |
| `php artisan encrypt-source --destination=encrypted-source --keylength=8` | Encrypts default source to `encrypted-source` directory and the encryption key length is `8`. |
| `php artisan encrypt-source --destination=encrypted-source --key="somecustomstrongstring"` | Encrypts default source to `encrypted-source` directory and the encryption key is `somecustomstrongstring` |Updated with ♥ by The Departed
Support can be shared by staring this repository.