laravel-release-protection maintained by yaroslawww
Description
Protect your routes for not allowed users.
Author
Last update
2023/08/20 09:07
(dev-main)
License
Downloads
31
Tags
Laravel: release protection
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' ] );



