title: Tracking records created by different users of a multi user application in Laravel 6
body: <p>i am working on a multi user application where i have two tables for authentication, admins table and users table.
  currently when a user registers, their information gets saved in the admins
  table(which automatically makes them admins for the registered account) and are authenticated using the same table.
  These admins can create other users and assign roles and permisions to restrict them from accessing certain information associated with that account.
  These users are saved in the users table with admin_id to track which account they belong to,they are authenticated using the same users table.</p>
  
  <p>Now my issue is how to track all records created by all these different users of the account.
  For instance when and admin creates a post, the admin_id will be used to track the post and when a user creates a post the user_id will be used to track the post and with the help of a hasManyThrough relationship between the Admin,User and Post models all posts associated with the account can be obtained and displayed to the admin.
  But for a case where a user is given the permision to view all posts associated with the account i do not know how this is going to work.
  Initially, what i wanted to do to avoid all these confusion was, during authentication,i would just get the id (if admins table is being used for auth) or admin_id (if users table is being used) and store as account_id in localstorage or session.
  This way, account_id will be the same for all the different users of the account and posts created by an admin of an account will be tracked with the same id as posts created by different users of the same account.
  So is this approach good enough?
  Is there a better approach to this problem?
  and finally is this a dumb question?
  Help me out guys!
  Thanks in advance.</p>