Git Product home page Git Product logo

laravel-source-encrypter's Introduction

Laravel Source Encrypter

StyleCI Latest Stable Version License CodeFactor

This package encrypts your php code with phpBolt

For Laravel and Lumen 6, 7, 8, 9

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 sbamtr/laravel-source-encrypter

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' => [
    // ...
    \sbamtr\LaravelSourceEncrypter\SourceEncryptServiceProvider::class,
];

For Lumen

Add this line of code under the Register Service Providers section of your bootstrap/app.php:

$app->register(\sbamtr\LaravelSourceEncrypter\SourceEncryptServiceProvider::class);

Step 4 (Optional)

You can publish the config file with this following command:

php artisan vendor:publish --provider="sbamtr\LaravelSourceEncrypter\SourceEncryptServiceProvider" --tag=config

Note: If you are using Lumen, you have to use this package.

Usage

Open terminal in project root and run this command:

php artisan encrypt-source

This command encrypts files and directories in config/source-encrypter.php file. Default values are app, database, routes.

The default destination directory is encrypted. You can change it in config/source-encrypter.php file.

Also the default encryption key length is 6. You can change it in config/source-encrypter.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.

Written with โ™ฅ by Siavash Bamshadnia.

Please support me by staring this repository.

laravel-source-encrypter's People

Contributors

siavashbamshadnia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.