antoinelemaire / blacklist-bundle
Provides a Blacklist system for Symfony using Annotations with Sonata admin integration.
Installs: 49
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^5.5.0 || ^7.0
- commerceguys/enum: ^1.0
- doctrine/common: ^2.3
- knplabs/doctrine-behaviors: ~1.4
- sonata-project/admin-bundle: ^3.30.1
- symfony/debug: ^3.0 || ^4.0
- symfony/framework-bundle: ^3.3 || ^4.0
- symfony/validator: ^3.3 || ^4.0
Requires (Dev)
- doctrine/doctrine-bundle: ^1.8
- doctrine/doctrine-fixtures-bundle: ^2.0
- doctrine/orm: ^2.5.4
- friendsofphp/php-cs-fixer: ^2.11
- sensio/framework-extra-bundle: ^5.0
- symfony/class-loader: ^3.3
- symfony/yaml: ^3.3 || ^4.0
This package is auto-updated.
Last update: 2024-11-18 02:51:41 UTC
README
Blacklist system with integration in Symfony. Just insert blacklist value/type combinaison inside database and use Annotation to assert.
Installation
Add the package to your composer.json file
"antoinelemaire/blacklist-bundle": "dev-master",
Add this to app/AppKernel.php
<?php public function registerBundles() { $bundles = array( ... new AntoineLemaire\BlacklistBundle\AntoineLemaireBlacklistBundle(), ); ... return $bundles; }
Configuration
Sonata admin:
sonata_admin: dashboard: groups: antoinelemaire_blacklist: label: Blacklist label_catalogue: AntoineLemaireBlacklistBundle items: - AntoineLemaire\BlacklistBundle\Admin\BlacklistAdmin
Usage
Available types:
email
email_domain
(when 'email=true' is defined, apply the constraint only on the domain part of the value)ip
class User
{
/**
* @var string
* @IsNotBlacklisted(type="email")
* @IsNotBlacklisted(type="email_domain", email=true)
*/
private $email;
/**
* @var string
* @IsNotBlacklisted(type="ip", message="This IP is blacklisted.")
*/
private $ip;
}