Streamline User Deletion with Laravel Account Deletion
This Composer package automates account deletion in Laravel, providing a pre-built form and efficient process for developers.
Installation and Setup
Installation and Setup
Composer Installation
Install the package using Composer:
composer require appdigidelete/account-deletion
Configuration
Update your .env file with database credentials and tables:
DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_DATABASE=your_databaseDB_USERNAME=your_usernameDB_PASSWORD=your_passwordUSER_TABLE=existing_usersDELETED_USERS_TABLE=deleted_users

Email Configuration
Email Configuration
SMTP Settings
Configure your .env file with SMTP credentials:
MAIL_MAILER=smtpMAIL_HOST=smtp.yourservice.comMAIL_PORT=587MAIL_USERNAME=your_email@domain.comMAIL_PASSWORD=your_passwordMAIL_ENCRYPTION=tlsMAIL_FROM_ADDRESS=your_email@domain.com
Clear Cache
Clear the configuration cache after making changes:
php artisan config:clearphp artisan view:clear

Queue Configuration
Queue Configuration
Database Driver
Set up the database driver for your queue. Run the following commands to create the jobs table:
composer require appdigidelete/account-deletion
Queue Worker
Start the queue worker to process jobs:
php artisan queue:work
Usage and Dependencies
Usage and Dependencies
Email Functionality
The package relies on the Illuminate/Mail component to send deletion confirmation emails.
Database Setup
Ensure your database has tables for existing users and deleted users.
Framework Integration
The package integrates with the Illuminate/Support component for Laravel framework functionality.

Existing User
Deleted User
Database Setup
Database Setup
Existing Users Table
The default table name is existing_users.
Deleted Users Table
The default table name is deleted\_users.
Migrations
Start the queue worker to process jobs:
php artisan queue:work
Existing Users Table
The default table name is existing_users.
Deleted Users Table
The default table name is deleted\_users.
Migrations
Start the queue worker to process jobs:
php artisan queue:work

User Deletion Process
User Deletion Process
User Request
The user requests account deletion through the pre-built form.
Email Confirmation
An email confirmation with a unique link is sent to the user.
User Confirmation
The user clicks the link in the email to confirm deletion.
Account Deletion
The user's account is deleted and data is transferred to the deleted_users table.
Key Takeaways and Next Steps
Key Takeaways and Next Steps
Streamlined Deletion
The package simplifies account deletion for developers by providing a pre built form and automating the process.
Secure Process
Deletion requests are confirmed through email, ensuring user consent and data security.
Scalable Solution
The package is designed for integration with Laravel applications, making it suitable for projects of any size.
