milenmk / laravel-gdpr-exporter
A GDPR-compliant user data exporter with Livewire support.
Requires
- php: ^8.2|^8.3|^8.4
- ext-simplexml: *
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- illuminate/view: ^10.0|^11.0|^12.0
- livewire/livewire: ^3.0|dev-main
Requires (Dev)
- laravel/pint: ^1.20
- tightenco/duster: ^2.7
Conflicts
- laravel/framework: <10.0
This package is auto-updated.
Last update: 2025-07-31 04:39:07 UTC
README
A lightweight Livewire component for exporting user data in multiple GDPR-compliant formats: JSON, CSV, XML, and HTML.
✨ Features
- Export authenticated user data in:
- ✅ JSON
- ✅ CSV
- ✅ XML
- ✅ HTML
- Automatically loads all Eloquent relations
- Filter out ID columns and other columns ending in
_id
or_by
- Streamed downloads
- Beautifully formatted output
- Built with Livewire 3
🧰 Requirements
- PHP 8.2+
- Laravel 10+
- Livewire 3+
📦 Installation
composer require milenmk/laravel-gdpr-exporter
🚀 Usage
-
Add the Livewire component in your Blade view:
<livewire:gdpr-exporter />
-
Optional: Publish the Blade view if you want to customize the UI:
php artisan vendor:publish --tag=laravel-gdpr-exporter-views
This will publish the file in
resources/views/vendor/laravel-gdpr-exporter/livewire/gdpr.blade.php
📁 Export Formats
Format | Output | Content-Type |
---|---|---|
JSON | Pretty-printed user data | application/json |
CSV | Key-value flat list | text/csv |
XML | Nested XML document | application/xml |
HTML | Styled HTML table | text/html |
🧠 How It Works
- Uses reflection to detect all Eloquent relationships on the User model.
- Loads relations and transforms the entire user structure to an array.
- Removes internal ID fields and flattens pivot data.
- Outputs the cleaned data in the selected format.
DISCLAIMER
This package is provided "as is" without warranty of any kind, either express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, or noninfringement.
The author(s) makes no representations or warranties regarding the accuracy, reliability or completeness of the code or its suitability for any specific use case. It is recommended that you thoroughly test this package in your environment before deploying it to production.
By using this package, you acknowledge and agree that the author(s) shall not be held liable for any damages, losses or other issues arising from the use of this software.
Contributing
You can review the source code, report bugs, or contribute to the project by visiting the GitHub repository:
Feel free to open issues or submit pull requests. Contributions are welcome!
License
This package is licensed under the MIT License. See the LICENSE file for more details.