Download the PHP package wazza/laravel-db-encryption without Composer

On this page you can find all versions of the php package wazza/laravel-db-encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-db-encryption

GitHub Actions GitHub issues GitHub stars GitHub license GitHub version Buy me a coffee

Laravel DB Encryption

A production-ready Laravel package for secure, transparent encryption of sensitive model attributes. Store encrypted data in a dedicated table while keeping your main tables clean and performant.

πŸ” Why This Package?

πŸ“‹ Requirements

πŸš€ Installation

1. Install via Composer

2. Publish Configuration & Migrations

3. Generate Encryption Key

This adds DB_ENCRYPT_KEY to your .env file.

4. Run Migrations

πŸ“– Usage

Basic Setup

Add the HasEncryptedAttributes trait to your model and define which attributes should be encrypted:

Working with Encrypted Attributes

Searching Encrypted Data

Use the whereEncrypted scope to search encrypted attributes:

Using the Facade

For direct encryption/decryption operations:

πŸ› οΈ Advanced Features

Artisan Commands

Generate Encryption Key

Re-encrypt Data (Key Rotation)

Prune Orphaned Records

Configuration

Edit config/db-encrypt.php:

Custom Exceptions

The package provides specific exceptions for better error handling:

πŸ”’ Security Best Practices

1. Key Management

2. What to Encrypt

βœ… Good candidates:

❌ Bad candidates:

3. Performance Considerations

4. Backup Strategy

See SECURITY.md for comprehensive security guidelines.

πŸ§ͺ Testing

πŸ› Troubleshooting

"Encryption key is not set"

Solution: Run php artisan db-encrypt:generate-key or manually set DB_ENCRYPT_KEY in .env

"Cannot encrypt attribute 'name' because it exists as a column"

Solution: Encrypted properties must NOT exist as database columns. Remove the column or choose a different property name.

"Decryption failed"

Possible causes:

Solution:

  1. Verify DB_ENCRYPT_KEY is correct
  2. Check logs for detailed error messages
  3. Restore from backup if data is corrupted

Performance issues

Solutions:

Search not finding records

Check:

πŸ“Š Monitoring

View Package Logs

Check Encryption Status

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Write tests for your changes
  4. Ensure all tests pass (./vendor/bin/pest)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

πŸ“œ License

This package is open-sourced software licensed under the MIT license.

πŸ‘¨β€πŸ’» Author

Warren Coetzee

πŸ™ Acknowledgments

β˜• Support

If this package helps you, consider buying me a coffee!

πŸ“ Changelog

See CHANGELOG.md for what has changed recently.

πŸ›‘οΈ Security

Please review our security policy for reporting security vulnerabilities.


Made with ❀️ for the Laravel community


All versions of laravel-db-encryption with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
ext-openssl Version *
illuminate/support Version ^12.0
illuminate/database Version ^12.0
illuminate/console Version ^12.0
php Version ^8.2 || ^8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wazza/laravel-db-encryption contains the following files

Loading the files please wait ...