slim - How to limit results by user globally in Eloquent? -


i using eloquent part of slim 3 project slim-jwt-auth (https://github.com/tuupola/slim-jwt-auth), outside of laravel. there many situations want control items returned based on user making request.

from understand though, there no way add parameters such user_id use in eloquent global scope.

i found 1 blog post looked helpful, trying achieve (http://www.sdavara.com/eloquent-global-scopes-a-cool-and-easy-way-to-fetch-loggedin-user-data/), relies on laravel auth.

the fact solution needs work globally important, have many nested relationships should filtered user id when queried.

could suggest might best approach achieving this?


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -