Entrust is a succinct and flexible way to add Role-based Permissions to Laravel 5. The default migration takes advantage of onDelete('cascade') clauses within the pivot tables to remove relations when a parent record is deleted. If for some reason you cannot use cascading deletes in your database, the EntrustRole and EntrustPermission classes, and the HasRole trait include event listeners to manually delete records in relevant pivot tables. In the interest of not accidentally deleting data, the event listeners will not delete pivot data if the model uses soft deleting. However, due to limitations in Laravel's event listeners, there is no way to distinguish between a call to delete() versus a call to forceDelete(). For this reason, before you force delete a model, you must manually delete any of the relationship data (unless your pivot tables uses cascading deletes).

Features

  • Store role records
  • Store permission records
  • Store many-to-many relations between roles and users
  • Assign roles to the users
  • Add permissions to each role
  • You can have as many Roles as you want for each User and vice versa

Project Samples

Project Activity

See All Activity >

Categories

Security

License

MIT License

Follow ENTRUST

ENTRUST Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of ENTRUST!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Security Software

Registered

2021-09-03