jaydeepukani / laravel-source-obfuscator
Laravel Source Obfuscator
Installs: 100
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/jaydeepukani/laravel-source-obfuscator
Requires
- php: >=7.2|>=8.0
- ext-bolt: *
- illuminate/console: ^6|^7|^8|^9|^10|^11
- illuminate/support: ^6|^7|^8|^9|^10|^11
README
This package is forked from sbamtr/laravel-source-obfuscator This package encrypts your php code with phpBolt
For Laravel 6, 7, 8, 9, 10, 11
Installation
Step 1
At the first, You have to install phpBolt.
Step 2
Require the package with composer using the following command:
composer require --dev jaydeepukani/laravel-source-obfuscator
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:
'providers' => [ // ... \JaydeepUkani\LaravelSourceObfuscator\SourceEncryptServiceProvider::class, ];
Step 4 (Optional)
You can publish the config file with this following command:
php artisan vendor:publish --provider="JaydeepUkani\LaravelSourceObfuscator\SourceEncryptServiceProvider" --tag=config
Usage
Open terminal in project root and run this command:
php artisan encrypt-source
This command encrypts files and directories in config/source-obfuscator.php file. Default values are app, database, routes.
The default destination directory is encrypted. You can change it in config/source-obfuscator.php file.
Also the default encryption key length is 6. You can change it in config/source-obfuscator.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 |
| keylength | Encryption key length | 6 |
| 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=dist |
Encrypts with default source and key length to dist directory. |
php artisan encrypt-source --destination=dist --keylength=8 |
Encrypts default source to dist directory and the encryption key length is 8. |
