Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseRepository::forceDelete() #722

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

robertoarruda
Copy link
Contributor

@robertoarruda robertoarruda commented Aug 6, 2020

Created the method BaseRepository::forceDelete(), to force a hard delete on a soft deleted model to a entity in repository by id.
https://laravel.com/docs/7.x/eloquent#soft-deleting

@lloricode
Copy link
Contributor

and also, if you add a soft deleting functions, can you add restore function?

also, make validate the model if uses soft delete trait, so unexpected behavior will not occur

@robertoarruda
Copy link
Contributor Author

and also, if you add a soft deleting functions, can you add restore function?

According! Restore function added.

also, make validate the model if uses soft delete trait, so unexpected behavior will not occur

It is not necessary, since Eloquent already guarantees operation even without the SoftDelete trait
https://github.com/illuminate/database/blob/master/Eloquent/Model.php#L980

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants