vinicius73/laravel-model-shield
Laravel Model Shield adds a lightweight protection layer around your Eloquent models, letting you guard sensitive attributes, control mass assignment and keep model data safe through simple, expressive configuration.
ShieldSentry), meaning the package will plug into Cartalyst\Sentry's Eloquent user model. This is a signal for products still running Sentry-based auth: integration cost is now a trait import, not a custom bridge. It also flags a strategic question — is the roadmap committed to Sentry (effectively unmaintained) or migrating to native Laravel gates/policies?ShieldSentry creates a small, well-isolated piece of technical debt (one trait, one base-class change) that can be swapped later. That makes it reasonable to adopt now and migrate deliberately rather than block the feature.Adopt when:
use ShieldSentry; on a Sentry Eloquent user is a one-line adoption path.Look elsewhere when:
AuthorizesRequests conventions.toArray()/query-builder paths.For executives (one paragraph). We evaluated ModelShield, a small Laravel package that lets a model declare which attributes a given user is allowed to see or touch, enforced in one place instead of scattered across controllers. The new v1.1 release adds a first-class adapter for Cartalyst Sentry, the permission system used by our legacy user model, which reduces integration to a single trait on our User class. The upside is a smaller, more auditable authorization surface and cheaper "who can see what" features. The caveat is dependency risk: this sits on the security path, and Sentry itself is not actively maintained, so adoption should be paired with a documented review and a plan to migrate to native Laravel policies.
For engineering. v1.1 ships Vinicius73\ModelShield\Traits\ShieldSentry, applied to a Sentry Eloquent user model. This tells us the package is designed to compose with an existing permission provider rather than own one — good separation, low coupling. Practical guidance: (1) confirm the trait's rules resolve through our Sentry permission checks as expected and cannot be short-circuited by direct query-builder access or raw toArray(); (2) pin the version and add it to the dependency-review list given it sits on the auth path; (3) keep the shielded rules declarative and reviewed in PRs so they read like a policy file; (4) treat the Sentry coupling as transitional — the trait is a thin seam, so a later swap to native policies is a contained change. If we adopt, timebox a spike against one representative model before rolling out broadly.
How can I help you explore Laravel packages today?