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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -