Laravel API endpoint pattern

Posted 8 months ago by tiagomatosweb

Hi guys, just a quick curious question to see how would you devs set up your endpoints.

Models

  • User
  • Job

Relationship User hasMany Job

Considering that:

  • Normal users can only update their own jobs
  • Admin users can update any jobs

With that simple scenario in mind to get the current user (authenticated) job, would you use /me/jobs/{jobId}

or

/jobs/{jobId}

Won't talk much trying to not be biased.

Tks

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.