How do you handle different policies on one resource depending on the controller called?

This page summarizes the projects mentioned and recommended in the original post on /r/laravel

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • laravel-permission

    Associate users with roles and permissions

  • I found interesting that the Spatie permission package recommends in their docs to include the authorization logic inside policies to encapsulate the code. But if policies are not in the equation feels like authorization ends up being spread across controllers and I didn't find the "laravel way" to do role based authorization besides gates, but even then it seems like a less refined solution than policies.

  • bouncer

    Laravel Eloquent roles and abilities.

  • That'd be great honestly, but I haven't found anything similar yet. I took a look at Bouncer but it doesn't seem to solve the problem either, just resource-based authorization too.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts