We are creating an application which will share objects with other users in the same group. For instance, when object A is created by user 1, and user 2 is added to the same group, the object A has to be available for user 2.
Currently, the user_id is saved for the objects, and there are found based on this ID:
$q = A::where('user_id', Auth::$user->id); return $q->get();
However, we want to return al the objects from A from all the users who are in a group. My instinct would to make a user_group table and a usergroups table to link users to each other and replace Auth::$user->id with all id's from the group(s) the user is in. But is that the optimal method, from an performance perspective?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community