mikebronner / laravel-model-caching

Eloquent model-caching made easy.
MIT License
2.26k stars 215 forks source link

Add support for withoutGlobalScopes #424

Closed gitwilliam closed 2 years ago

gitwilliam commented 2 years ago

The intention of this PR is to add in support for the withoutGlobalScope and withoutGlobalScopes function in Eloquent (https://laravel.com/docs/8.x/eloquent#removing-global-scopes).

When an application using the Caching Library applies the withoutGlobalScopes() modifier to a model, the global scopes are currently being added back in by the Caching Library. This requires the client application to disable the cache, disableCache(), prior to calling withoutGlobalScopes. This PR should fix that.

mikebronner commented 2 years ago

@gitwilliam Thank you so much for all the work you put into this! I will review and merge by the end of this weekend and release a new version if everything is working. :)

gitwilliam commented 2 years ago

@gitwilliam Thank you so much for all the work you put into this! I will review and merge by the end of this weekend and release a new version if everything is working. :)

Thanks for looking at it @mikebronner. I fully admit that there are still a lot of things about the library that I don't understand. So feel free to send me off to correct anything you think is not in keeping with design or intention.