A Laravel package that simplifies blocking and banning Eloquent models with support for multiple bans, soft deletes, and middleware.
Laravel Ban is a Laravel package that provides a simple and elegant way to add banning functionality to Eloquent models. It solves the problem of managing user or model bans in Laravel applications by offering features like temporary bans, ban history, route protection middleware, and event-driven integrations. It extends beyond just users, allowing any Eloquent model to be bannable.
Laravel developers building applications that require user moderation, access control, or content restriction features, such as forums, admin panels, or community platforms.
Developers choose Laravel Ban because it integrates seamlessly with Laravel's ecosystem, uses traits for easy implementation, supports complex ban scenarios (like multiple bans and expirations), and includes ready-to-use middleware and events, reducing custom code and maintenance overhead.
Laravel Ban simplify blocking and banning Eloquent models.
Supports many bans per model, enabling detailed moderation history and complex scenarios like repeated offenses.
Keeps removed bans as soft-deleted records, preserving compliance-friendly history without data loss.
Includes middleware to block or automatically log out banned users on protected routes, reducing custom access control code.
Works with any Eloquent model, such as Teams or Organizations, not just Users, extending banning capabilities broadly.
Tightly coupled with Laravel's ecosystem, making it unsuitable for non-Laravel projects or custom ORMs, leading to vendor lock-in.
Requires adding database columns and traits to models, which adds initial configuration steps compared to simpler flag-based approaches.
Ban checks rely on database queries and scopes, potentially increasing query load in high-traffic applications with extensive ban records.
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Debugbar for Laravel (Integrates PHP Debug Bar)
IDE Helper for Laravel
PHP Image Processing
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.