yaroslawww / laravel-release-protection
This package is abandoned and no longer maintained.
The author suggests using the think.studio/laravel-release-protection package instead.
Protect your routes for not allowed users.
1.1.0
2023-08-20 07:07 UTC
Requires
- php: ^7.4|^8.0
- laravel/framework: ^9.0|^10.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.16
- orchestra/testbench: ^8.5
- phpunit/phpunit: ^10.1
- psalm/plugin-laravel: ^2.8
- vimeo/psalm: ^5.11
This package is auto-updated.
Last update: 2023-08-20 07:19:45 UTC
README
Protect your routes for not allowed users.
Installation
Install the package via composer:
composer require think.studio/laravel-release-protection
You can publish the config file with:
php artisan vendor:publish --provider="ReleaseProtection\ServiceProvider" --tag="config"
Configuration in .env (optional)
RPROTECT_TESTERS_EMAILS="myemail@test.com,otheremail@test.com" RPROTECT_FIRST_PARTY_IPS="123.4.5.6,123.4.5.7"
Usage
Add new middlewares
# app/Http/Kernel.php protected $routeMiddleware = [ // ... 'first-party-ip' => \ReleaseProtection\Http\Middleware\VerifyFirstPartyClientIp::class, 'testers-email' => \ReleaseProtection\Http\Middleware\TestersEmailMiddleware::class, ];
Add middleware to routes
Route::middleware([ 'auth', 'testers-email:auth' ]) ->group(function () { // }); Route::get( 'my/events', \App\Http\Controllers\Events::class ) ->middleware( [ 'first-party-ip:events' ] );