devworkout / multisignup
dev-master
2023-02-03 19:41 UTC
Requires
- devworkout/laravel-user-ips: dev-master
Requires (Dev)
- larapack/dd: ^1.0
- phpunit/phpunit: *
This package is auto-updated.
Last update: 2025-03-01 00:20:55 UTC
README
Prevent multiple signups from IP in Laravel.
Installation
You can install the package via composer:
composer require devworkout/multisignup
Migrate the database:
php artisan migrate
Publish config:
php artisan vendor:publish
Default settings:
return [ 'max_signups_from_ip' => 1, ];
Usage
Using Facade
$canSignup = MultiSignup::ipReachedMaxSignups(); // or $canSignup = MultiSignup::hasNosignupCookie(); // or both $canSignup = MultiSignup::canSignUp(); // manually prevent signups $canSignup = MultiSignup::setNosignupCookie();
Using Middleware
In your Http\Kernel:
protected $routeMiddleware = [ //... 'prevent-multiple-signups' => \DevWorkout\MultiSignup\Http\Middleware\PreventMultipleSignups::class, ];
In your RegisterController:
public function __construct() { $this->middleware('guest'); $this->middleware('prevent-multiple-signups'); }
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email us instead of using the issue tracker.
Credits
Support us
Give us a star!
License
The MIT License (MIT). Please see License File for more information.