vantage/authorized-attributes
A Laravel package for attribute-level authorization: control which model attributes users can view or update using policies and PHP attributes, keeping sensitive fields protected across requests and resources.
$visible toggling per role, ad-hoc makeHidden() calls. Buying (adopting) a focused MIT package is attractive if the abstraction matches your mental model; building is attractive if your rules are row- or context-dependent.Consider it when:
$hidden/$visible/resource classes have become a maintenance problem.Look elsewhere (or build) when:
For executives: This is a small, MIT-licensed Laravel library that lets us control which data fields each user role can see, declaratively, in one place. It supports two business outcomes: (1) selling differentiated data access by plan, and (2) demonstrating least-privilege handling of customer data for compliance and security reviews. Cost is near zero and it is easy to remove, but it is early-stage — 23 stars, no known dependents — so the recommendation is a scoped pilot with a fork contingency, not a platform-wide standard.
For engineering: It addresses attribute-level authorization, a concern we currently handle inconsistently across API resources and ad-hoc makeHidden() calls. Adoption means one declarative rule set instead of scattered conditionals, aligned with Laravel's existing gate/policy model. The trade-off is dependency maturity: we should read the source, pin a version, cover it with tests at the serialization boundary, and be prepared to vendor it. If our requirements drift toward row-level or context-heavy authorization, we stop and build instead.
How can I help you explore Laravel packages today?