Download the PHP package dev-reymark/laravel-source-encryptor without Composer
On this page you can find all versions of the php package dev-reymark/laravel-source-encryptor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dev-reymark/laravel-source-encryptor
More information about dev-reymark/laravel-source-encryptor
Files in dev-reymark/laravel-source-encryptor
Package laravel-source-encryptor
Short Description Encrypt Laravel source code for secure Laravel distribution
License MIT
Homepage https://github.com/dev-reymark/laravel-source-encryptor
Informations about the package laravel-source-encryptor
Laravel Source Encryptor
Encrypt Laravel source code and safely distribute applications without exposing PHP source files. Converts your Laravel application's PHP files into encrypted code that is decrypted only at runtime, allowing you to distribute Laravel applications while protecting your intellectual property.
Features
- Encrypt controllers, models, services, and routes
- Bundle encrypted code into a single runtime file
- Runtime decryption via custom autoloader
- Automatic Composer and npm build handling
- Cross-platform (Windows, Linux, macOS)
- Laravel 7.x through 13.x support
- Optimized distribution builds
- No external PHP extensions required
Quick Installation
The source:install command will automatically publish the configuration file and securely generate and inject a SOURCE_ENCRYPTION_KEY into your .env file.
Usage
Build Production Distribution
The command will:
- Installs Composer dependencies (--no-dev)
- Installs npm dependencies if needed
- Builds frontend assets (Vite / React / Vue)
- Encrypts Laravel source files
- Bundles encrypted code into a runtime file
- Removes the original app/ directory
- Generates encrypted route loaders
- Create a clean distribution folder at
dist/
Distribution Structure
The original app/ directory is removed. All encrypted source code is stored inside bootstrap/cache/source.enc.
Build Options
Skip frontend build:
By default, the build command will automatically attempt to run npm install and npm run build if it detects frontend assets. Use the --no-frontend flag to skip this process entirely. This is highly recommended for API-only applications or if you compile your frontend assets separately.
Skip composer install:
By default, the build command automatically runs composer install --no-dev inside the new dist/ directory. Use the --skip-composer flag to skip this step if you are running the build in a CI/CD pipeline or Docker environment where you prefer to handle Composer installation manually to utilize caching and speed up build times.
Configuration
You can customize the encryption behavior by modifying the config/source-encryptor.php file.
Excluding Directories from Encryption
If you have specific directories (or files) that you want to exclude from the encryption process (for example, if they need to be readable by third-party packages or contain specific assets), you can add them to the exclude array:
Any files inside these excluded paths will be copied over to the dist directory exactly as they are, without being encrypted.
Running the Encrypted Application
Laravel automatically loads encrypted classes through the runtime loader.
How It Works
- PHP files are compressed and encrypted using AES-256-CBC
- Encrypted code is bundled into
bootstrap/cache/source.enc - During runtime: Autoload request → EncryptedAutoloader → SourceLoader decrypts → PHP executes
- Decrypted source never persists on disk
Frontend Support
The build system automatically detects frontend environments:
| Environment | Behavior |
|---|---|
| API-only Laravel | Skips frontend build |
| Laravel + Blade | Skips if no build script |
| Vue Starter Kit | Runs npm install + npm run build |
| React Starter Kit | Runs npm install + npm run build |
| Vite Projects | Fully supported |
Requirements
- PHP 7.2.5+
- Laravel 7.x - 13.x
- OpenSSL extension enabled
- Composer
Security Notes
- Keep your
SOURCE_ENCRYPTION_KEYprivate - Never commit
.envto version control - Only distribute the
dist/directory
License
MIT License
Author
Rey Mark Tapar
All versions of laravel-source-encryptor with dependencies
illuminate/support Version ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0