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

Soft deleting trix_rich_texts and trix_attachments for a model #40

Open
mattgroom opened this issue Aug 25, 2020 · 3 comments
Open

Soft deleting trix_rich_texts and trix_attachments for a model #40

mattgroom opened this issue Aug 25, 2020 · 3 comments

Comments

@mattgroom
Copy link

Hi

Just working on deleting records from one of my models, but notice that when soft deleting an entry, it doesn't cascade down and soft delete the entries in the trix database tables for the model I soft deleted. I couldn't see anything in the documentation about deleting records, so wanted to ask if I need to setup foreign keys on the tables so there is a link between entries to cascade down, or if there is a better way to achieve this? Any suggestion greatly appreciated.

Many thanks

Matt

@amaelftah
Copy link
Owner

hey Matt

i don't think you will need to add foreign keys . you can do this $post->trixRichText()->delete(); and this will permanetly delete the trix record

@mattgroom
Copy link
Author

amazing - many thanks, I'll give that a go. Much appreciated - the trix package as worked great for the project. Thanks again!

@amaelftah
Copy link
Owner

glad you found it useful ☺️

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

No branches or pull requests

2 participants