1. Go to this page and download the library: Download manggala/sentinel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
manggala / sentinel example snippets
use Manggala\Sentinel\Http\Middleware\SentinelGuardMiddleware;
use Manggala\Sentinel\Http\Middleware\SentinelBruteForceMiddleware;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
// Daftarkan WAF guard global
$middleware->append(SentinelGuardMiddleware::class);
// Daftarkan Brute Force guard pada endpoint auth
$middleware->alias([
'sentinel.bruteforce' => SentinelBruteForceMiddleware::class,
]);
})
->create();
use Manggala\Sentinel\Facades\Sentinel;
// Memeriksa apakah IP diblokir
if (Sentinel::isIpBlocked('192.168.1.50')) {
// IP sedang diblokir
}
// Memblokir IP secara manual
Sentinel::blockIp('192.168.1.50', 'Aktivitas peretasan mencurigakan');
// Membuka blokir IP
Sentinel::unbanIp('192.168.1.50');
// Mendapatkan ringkasan statistik keamanan
$stats = Sentinel::getMetrics();
bash
php artisan sentinel:install
bash
php artisan migrate
bash
php artisan sentinel:install
bash
php artisan sentinel:unban 192.168.1.100
bash
php artisan sentinel:whitelist 10.0.0.1
bash
php artisan sentinel:clear-logs --days=30
bash
php artisan sentinel:stats
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.