PHP code example of zobayer / encapsula

1. Go to this page and download the library: Download zobayer/encapsula library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zobayer / encapsula example snippets


'providers' => [
    // ...
    Zobayer\Encapsula\EncapsulaServiceProvider::class,
],

// In routes/api.php
Route::middleware('encapsula.encrypt')->group(function () {
    Route::get('/users', [UserController::class, 'index']);
    Route::get('/orders', [OrderController::class, 'index']);
});
bash
php artisan encapsula:setup
bash
php artisan vendor:publish --tag=encapsula-config
bash
php -r "echo base64_encode(random_bytes(32));"
bash
# Install PHP dependencies
composer install

# Run PHP tests
vendor/bin/phpunit

# Run static analysis
vendor/bin/phpstan analyse

# Check PHP code style
vendor/bin/pint --test

# Fix PHP code style
vendor/bin/pint

# Work on frontend client
cd packages/client
npm install
npm run typecheck
npm test
npm run build