Download the PHP package brendantwhite/databasemask without Composer

On this page you can find all versions of the php package brendantwhite/databasemask. 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 databasemask

DatabaseMask

Mask data from Production using Faker to use safely elsewhere.

Use Case

Ever wanted to use a copy of your Laravel project's Production database in your test environments? But you can't, because it's a security risk?

Now, you can get a copy of the Production database and mask just the values that need masking - names, phone numbers, email addresses etc - while keeping your data otherwise intact.

Installation

From the command line run:

composer require brendantwhite/databasemask

Configuration

First, ensure you have a Model Factory defined for each Eloquent model class that you want to mask.

Then, add a $masked property to your Eloquent model classes, specifying which attributes on your model should be masked.

If you have any models that you don't need to be masked at all, add the $masked property anyway, but make it an empty array.

Usage

To mask your data, run the php artisan dbm:mask command. This will loop through all your Eloquent models, looking for the $masked property.

But if the $masked property contains field names, and a Factory has been created, then the fields in the $masked property will be replaced with Faker values. All other fields will be left untouched.

Backup and Restore

This package also contains light wrappers around Spatie's excellent laravel-db-snapshots package, to make backups and restores even easier.

To use these commands you will first need to install laravel-db-snapshots as per their installation instructions.

Then, run php artisan dbm:backup to create a backup file of your database on your snapshots disk. Run php artisan dbm:restore to choose a backup file and restore it to your current enviroment.

Generally, you'll want to backup from your Production enviornment, and restore to some other environment, and then mask that data in the other environment.

You do not need to install laravel-db-snapshots if you only want to use the dbm:mask command.

Testing DatabaseMask

TODO: write some tests.

Disclaimer

I cannot, and do not, guarantee that using DatabaseMask will make your data 100% de-identified.

I can and will make a good-faith effort to ensure that, when configured correctly, DatabaseMask will remove personally idendifiable information from your data.

However I cannot guarantee that this software is 100% bug-free, and I certainly can't guarantee that you have configured it correctly. So use this software at your own risk.

License

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


All versions of databasemask with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^8.67|^9.0
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 brendantwhite/databasemask contains the following files

Loading the files please wait ....