{"repo":"mchev/banhammer","free":true,"listed":false,"github":"https://github.com/mchev/banhammer","clone":"git clone https://github.com/mchev/banhammer.git","description":"Banhammer for Laravel offers a simple way to ban any Model by ID, UUID and by IP or Country.","language":"PHP","stars":373,"topics":["autorization","ip","laravel","ban","package","php","access","restrict","trait","user"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Banhammer 🔨 A simple and powerful ban package for Laravel - ban models, IPs, and countries with ease. Banhammer allows you to ban any Eloquent model, IP addresses, and even entire countries. Bans can be permanent or temporary with automatic expiration. --- 📋 Table of Contents - Quick Start - Features - Installation - Usage Guide - Banning Models - Banning IPs - Country Blocking - Middleware - Scheduler - Events - Advanced Topics - Metas - UUIDs - Upgrading - Development --- 🚀 Quick Start Add the trait to your model: Ban a user: --- ✨ Features - ✅ Ban any Eloquent model (User, Team, etc.) - ✅ Ban IP addresses (single or multiple) - ✅ Block entire countries - ✅ Temporary or permanent bans - ✅ Automatic expiration handling - ✅ Middleware protection - ✅ Event system - ✅ Metadata support --- 📦 Installation Requirements - PHP 8.0+ Laravel compatibility Laravel Supported since Banhammer -------- ---------------------------- 9.x v1.0.0 10.x v1.0.0 11.x v2.2.0 12.x v2.4.0 13.x v2.5.0 Setup 1. Install the package: 2. Publish and run migrations: 3. Publish config (optional): 💡 The config file allows you to customize table name, model, fallback URLs, and more. --- 📖 Usage Guide Banning Models Make a Model Bannable Add the Bannable trait to any model: 💡 You can add the trait to multiple models (User, Team, Group, etc.) Basic Operations Action Code -------- ------ Ban a user $user- ban() Ban with expiration $user- banUntil('2 days') Check if banned $user- isBanned() Check if not ban","default_branch":null,"files":null,"tree":[],"storefront":"/r/mchev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mchev/banhammer/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}