18

GitHub - spatie/personal-data-download: Create zipfiles containing personal data

 5 years ago
source link: https://github.com/spatie/personal-data-download
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

THIS PACKAGE IS IN DEVELOPMENT, DO NOT USE YET

Create personal data downloads in a Laravel app

Latest Version on Packagist Build Status StyleCI Code coverage Quality Score Total Downloads

This package makes it easy to let a user download all personal data. Such a download consists of a zip file containing all user properties and related info.

You can create and mail such a zip by dispatching this job

// in a controller

use Spatie\PersonalDataDownload\Jobs\CreatePersonalDataDownloadJob;

// ...

dispatch(new CreatePersonalDataDownloadJob(auth()->user());

The package will create a zip, by default this will be done on a queue. When the zip has been created a link to it will be mailed to the user.

You can configure which data will be put in the download in the selectPersonalData method on the user.

// in your user model

public function selectPersonalData(PersonalDataDownload $personalDataDownload) {
    $personalDataDownload
        ->add('user.json', ['name' => $this->name, 'email' => $this->email])
        ->addFile(storage_path("avatars/{$this->id}.jpg");
}

Installation

You can install the package via composer:

composer require spatie/personal-data-download

Usage

$skeleton = new Spatie\Skeleton();
echo $skeleton->echoPhrase('Hello, Spatie!');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

Support us

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

License

The MIT License (MIT). Please see License File for more information.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK