You have 3 tables - users, posts, comments.
User has right to do CRUD with post and comments which means any user can create any post and leave any comment under any post. But, only owner of the post or the comment has right to update it or delete it, other users have no right to update and delete others posts or comments.
- Do it using Laravel Framework, version 9
- Database should be Postgres
- GET /api/users should return all users with posts and all comments which the current user left under any post
- GET /api/posts should return all posts belong to current user and all comments of each user
- POST /api/posts
- POST /api/comments