Tucker-Eric / EloquentFilter

An Eloquent Way To Filter Laravel Models And Their Relationships
http://tucker-eric.github.io/EloquentFilter
MIT License
1.72k stars 120 forks source link

Eloquent Filter overiding global scopes #115

Closed Drewdan closed 4 years ago

Drewdan commented 4 years ago

Looking to get some clarification.

I have added some global scopes to a model, which uses the Eloquent Filter. It appears when using the filter, these global scopes are not applied. Is this expected behaviour?

Thanks

Tucker-Eric commented 4 years ago

That's not the expected behavior. Global scopes should be in tact. Depending on how the global scopes are being applied and how the filter is being called could be the cause of the global scopes being overridden.

Drewdan commented 4 years ago

My apologies, after further digging, I realsied that the scope was being applied, but the builder not being updated properly as it could not access the Auth facade in the constructor which I believe is an issue specific to my project.

Thank you for your time!

Tucker-Eric commented 4 years ago

No worries! Glad you got it figure out! 👍