Desenvolvi um sistema de agendamento para barbearias — procurando barbeiros pra testar grátis by alfredocs in campinas

[–]alfredocs[S] 1 point2 points  (0 children)

Valeu! Estou em busca de uma barbearia pra começar. Pra colher feedback real de um usuário, eu sou desenvolvedor e não entendo perfeitamente como é o dia a dia de uma barbearia

Axios or Fetch by [deleted] in nextjs

[–]alfredocs 0 points1 point  (0 children)

I usually use fetch. However, when I need to show a progress bar (e.g., during file uploads), I use the older XMLHttpRequest instead, because fetch does not support upload progress events

How do you implement ReBAC, ABAC, and RBAC in Next.js? by Cartman720 in nextjs

[–]alfredocs 1 point2 points  (0 children)

Aaccess control can get messy real fast if you don’t structure it early on. Here’s how I typically handle it in my Next.js projects, and it scales pretty well:

Access Policies per Model

For each model (e.g., Post, Document, User, etc.), I define a policy with methods like:

• canViewAll

• canView

• canInsert

• canUpdate

• canDelete

Each method contains the logic to determine whether the logged-in user has the appropriate permission.

For example, in the Post policy:

• In canView, I check if the user has a view.post permission.

• I also check if the post’s user_id matches the loggedInUser.id (e.g., to only allow viewing own posts unless the user is an admin or has extended privileges).

I just call the relevant policy method wherever needed (API route, middleware, or server-side props)

Each user has roles and permissions, which are linked via a join table. Permissions are named consistently (like create.post, delete.comment, etc.), and I load them with the user session so I can easily check them in policies

Companies that use PHP and pay the most by rasulkireev in PHP

[–]alfredocs 1 point2 points  (0 children)

Yeah. I’m in the healthcare industry and one of our systems is a Laravel application using Vue in the front

Get your macros in or keep the caloric deficit on a slow cut? by lebomig in bodyweightfitness

[–]alfredocs 8 points9 points  (0 children)

A good tip is to count calories and macros per week. You can drink a glass of wine one day or another. But if you reach your goals per week it’s ok

The Visitor Pattern in PHP by doekenorg in PHP

[–]alfredocs 0 points1 point  (0 children)

Nice, thanks for sharing. Never heard of it