alializade/laravel-masked-db-dump
最新稳定版本:1.0.10
Composer 安装命令:
composer require alializade/laravel-masked-db-dump
包简介
Dump masked information from your database
README 文档
README
This package is a fork of masked-db-dump, A database dumping package that allows you to replace and mask columns while dumping your database.
Installation
You can install the package via composer:
composer require alializade/laravel-masked-db-dump
Usage
Use this dump schema definition to remove, replace or mask certain parts of your database tables.
use AliAlizade\LaravelMaskedDumper\DumpSchema; use AliAlizade\LaravelMaskedDumper\TableDefinitions\TableDefinition; use Faker\Generator as Faker; class CoreServiceProvider extends ServiceProvider { // ... public function boot(): void { //... $this->app->singleton('masked_dump_default', function () { return DumpSchema::define('mysql') ->allTables() ->table('users', function (TableDefinition $table) { $table->replace('name', function (Faker $faker) { return $faker->name; }); $table->replace('email', function (Faker $faker) { return $faker->lastName().'@fake.com'; }); $table->replace('password', function (Faker $faker) { return $password = bcrypt('secret'); }); }) ->schemaOnly('personal_access_tokens') }); // ... }
$ php artisan db:masked-dump output.sql
$ php artisan db:masked-dump output.sql --gzip
Documentation
The documentation can be found on the website.
Security
If you discover any security related issues, please email ali.alizade@outlook.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 4.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-29