Download the PHP package intellow/reuse-soft-deleted-user-email without Composer
On this page you can find all versions of the php package intellow/reuse-soft-deleted-user-email. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download intellow/reuse-soft-deleted-user-email
More information about intellow/reuse-soft-deleted-user-email
Files in intellow/reuse-soft-deleted-user-email
Package reuse-soft-deleted-user-email
Short Description When you soft delete a user, this trait allows that email address to be registered again in a different user account
License MIT
Homepage https://github.com/intellow/reuse-soft-deleted-user-email
Informations about the package reuse-soft-deleted-user-email
Reuse Soft Deleted Emails
When you soft delete a user in Laravel, that email cannot be registered again since the email field on the users table must be unique.
This package solves this problem and allows you to soft delete a user record, retain the original email as history, and still register a new user account with the same email address.
Installation
You can install the package via composer:
Usage
In a Laravel app with users and SoftDeletes, add the trait to your User model
Now when a user is deleted, their email in the database will change from [email protected]
to [email protected]_deleted
where 1574789049 is the timestamp when the user was deleted.
This allows another user to be registered with the email [email protected]
while retaining the record of the old deleted user.
The package adds an accessor to the User model, so if you access the trashed user and get their email, you will see [email protected]
without the appended timestamp_deleted string.
Expiration Date
Please note this package will cease to work on Sat 20 Nov 2286 05:46:40 PM UTC when the unix timestamp adds an 11th digit.
Changelog
Please see CHANGELOG for more information 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.
Credits
- Intellow
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.