laravel-json-api / eloquent

Serialize Eloquent models to JSON API resources
MIT License
12 stars 15 forks source link

Add support for boolean soft-deletion #9

Closed ben221199 closed 3 years ago

ben221199 commented 3 years ago

This PR adds support for boolean soft-deletion.

lindyhopchris commented 3 years ago

Sorry, I hadn't realised how extensive these changes would be.

Really this should have a separate driver, and a separate trait to the SoftDeletes trait this package already has. As it relies on a package that wouldn't normally be installed, I think maybe this needs to be laravel-json-api/boolean-softdeletes. Or you could publish as your own package? What's your preference?

lindyhopchris commented 3 years ago

Not sure how you're installing the boolean-softdeletes package, as it hasn't been updated for Laravel 8?

ben221199 commented 3 years ago

I use https://github.com/ben221199/laravel-boolean-softdeletes, but I haven't made a PR yet.

lindyhopchris commented 3 years ago

Ok, that makes sense. Shall I set up laravel-json-api/boolean-softdeletes or did you want to own the package?

ben221199 commented 3 years ago

Well, I was thinking about updating the orginal repository using a PR. You could always choose for yourself if you want your own boolean-softdeletes repository as long as it has the getIsDeletedColumn, but do you want it under the laravel-json-api organisation? It isn't really connected to that.

ben221199 commented 3 years ago

I have made a pull request for the library: https://github.com/tenantcloud/laravel-boolean-softdeletes/pull/7

ben221199 commented 3 years ago

The pull request is merged, so if you want to implement boolean soft-deletes, I would go for the official package: tenantcloud/laravel-boolean-softdeletes.

lindyhopchris commented 3 years ago

@ben221199 cheers, thanks for letting me know.

lindyhopchris commented 3 years ago

Closing this in favour of laravel-json-api/boolean-softdeletes

FYI that package will be ready to tag when the following PRs are merged: https://github.com/tenantcloud/laravel-boolean-softdeletes/pull/9 https://github.com/tenantcloud/laravel-boolean-softdeletes/pull/8

Those PRs are required to ensure the JSON:API boolean soft deletes implementation matches the standard soft deletes implementation.