PHPackages                             zawaulkawum/laravel-bolt-encrypt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. zawaulkawum/laravel-bolt-encrypt

ActiveLibrary[Security](/categories/security)

zawaulkawum/laravel-bolt-encrypt
================================

A Laravel package for encrypting PHP files using Bolt encryption

v1.0.0(7mo ago)016MITPHPPHP ^8.0

Since Sep 27Pushed 7mo agoCompare

[ Source](https://github.com/zawad1992/laravel-bolt-encrypt)[ Packagist](https://packagist.org/packages/zawaulkawum/laravel-bolt-encrypt)[ RSS](/packages/zawaulkawum-laravel-bolt-encrypt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

🔐 Laravel Bolt Encrypt
======================

[](#-laravel-bolt-encrypt)

[![Latest Stable Version](https://camo.githubusercontent.com/8565483ac268a55c9d49dbfb91fe4ef734dfd0563c50b577f20a8728c111f5aa/68747470733a2f2f706f7365722e707567782e6f72672f7a617761756c6b6177756d2f6c61726176656c2d626f6c742d656e63727970742f762f737461626c65)](https://packagist.org/packages/zawaulkawum/laravel-bolt-encrypt)[![Total Downloads](https://camo.githubusercontent.com/6901a75159015984120383d14f127f0c0307c06739ff85b96efdfc71bfff5afc/68747470733a2f2f706f7365722e707567782e6f72672f7a617761756c6b6177756d2f6c61726176656c2d626f6c742d656e63727970742f646f776e6c6f616473)](https://packagist.org/packages/zawaulkawum/laravel-bolt-encrypt)[![License](https://camo.githubusercontent.com/3d1df251c18177337ac66d7394de468ec70f8dfbff4ead9e4280ac7f57397dfd/68747470733a2f2f706f7365722e707567782e6f72672f7a617761756c6b6177756d2f6c61726176656c2d626f6c742d656e63727970742f6c6963656e7365)](https://packagist.org/packages/zawaulkawum/laravel-bolt-encrypt)[![PHP Version Require](https://camo.githubusercontent.com/a853d8af411b981c58777978f40c5bea607830a73a77ab793097d8188e8afad2/68747470733a2f2f706f7365722e707567782e6f72672f7a617761756c6b6177756d2f6c61726176656c2d626f6c742d656e63727970742f726571756972652f706870)](https://packagist.org/packages/zawaulkawum/laravel-bolt-encrypt)

A powerful Laravel package for encrypting PHP files with namespace support, perfect for protecting your source code before deployment or distribution.

✨ Features
----------

[](#-features)

- 🚀 **One-Command Encryption** - Encrypt your entire Laravel app with a single artisan command
- 📁 **Smart Directory Handling** - Automatically processes nested directories and maintains structure
- 🔍 **Namespace Aware** - Properly handles files with and without namespaces
- ⚙️ **Highly Configurable** - Customize source, destination, encryption keys, and exclusions
- 🎯 **Selective Encryption** - Exclude specific files from encryption process
- 📊 **Detailed Statistics** - Get comprehensive reports on the encryption process
- 🛡️ **Error Handling** - Robust error handling with detailed feedback
- 🔧 **Multiple Interfaces** - CLI commands, service classes, and optional web interface

---

📦 Installation
--------------

[](#-installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require zawaulkawum/laravel-bolt-encrypt
```

### Step 2: Publish Configuration (Optional)

[](#step-2-publish-configuration-optional)

```
php artisan vendor:publish --tag=file-encryptor-config
```

This will create `config/file-encryptor.php` where you can customize default settings.

### Step 3: Configure Environment Variables (Optional)

[](#step-3-configure-environment-variables-optional)

Add these to your `.env` file to override defaults:

```
FILE_ENCRYPTOR_SOURCE=app
FILE_ENCRYPTOR_DESTINATION=encrypted
FILE_ENCRYPTOR_KEY=your-secret-key
FILE_ENCRYPTOR_WEB=false
```

---

🚀 Quick Start
-------------

[](#-quick-start)

### Encrypt Your App Directory (Default)

[](#encrypt-your-app-directory-default)

```
php artisan encrypt:files
```

This will:

- ✅ Encrypt all PHP files in the `app` directory
- ✅ Copy non-PHP files as-is
- ✅ Create encrypted files in the `encrypted` directory
- ✅ Maintain the original directory structure
- ✅ Show detailed statistics

### Sample Output:

[](#sample-output)

```
Starting file encryption process...

┌─────────────────────┬──────────────┐
│ Setting             │ Value        │
├─────────────────────┼──────────────┤
│ Source Directory    │ app          │
│ Destination         │ encrypted    │
│ Encryption Key      │ ******       │
│ Excluded Files      │ 0 files      │
└─────────────────────┴──────────────┘

Do you want to proceed with encryption? (yes/no) [no]:
> yes

✅ Successfully Encrypted... Please check in /var/www/html/encrypted/app folder.

┌─────────────────────┬───────┐
│ Metric              │ Value │
├─────────────────────┼───────┤
│ Total Files         │ 45    │
│ PHP Files Encrypted │ 38    │
│ Files Copied        │ 7     │
│ Directories Created │ 12    │
│ Duration            │ 0.234 │
└─────────────────────┴───────┘

```

---

🎛️ Advanced Usage
-----------------

[](#️-advanced-usage)

### Custom Source and Destination

[](#custom-source-and-destination)

```
# Encrypt specific directory
php artisan encrypt:files --source=app/Models --destination=encrypted-models

# Encrypt with custom key
php artisan encrypt:files --key=my-super-secret-key

# Combine all options
php artisan encrypt:files --source=app/Services --destination=encrypted-services --key=custom-key
```

### Available Command Options

[](#available-command-options)

OptionDescriptionExample`--source`Source directory to encrypt`--source=app/Http``--destination`Destination for encrypted files`--destination=encrypted``--key`Custom encryption key`--key=my-secret-key`### Interactive Configuration

[](#interactive-configuration)

The command will always show you the configuration before proceeding:

```
php artisan encrypt:files --source=app/Http/Controllers
```

```
┌─────────────────────┬──────────────────────┐
│ Setting             │ Value                │
├─────────────────────┼──────────────────────┤
│ Source Directory    │ app/Http/Controllers │
│ Destination         │ encrypted            │
│ Encryption Key      │ ******               │
│ Excluded Files      │ 2 files              │
└─────────────────────┴──────────────────────┘

Do you want to proceed with encryption? (yes/no) [no]:

```

---

⚙️ Configuration
----------------

[](#️-configuration)

### Publishing and Editing Config

[](#publishing-and-editing-config)

```
php artisan vendor:publish --tag=file-encryptor-config
```

Edit `config/file-encryptor.php`:

```
