Illuminate\Auth), leveraging middleware and events (Illuminate\Auth\Events\Attempting, Authenticated, Failed).AuthCheckerEvents.auth_checker_devices, auth_checker_attempts, auth_checker_lockouts) with sensible defaults (e.g., failed_attempts counter, last_attempt_at). Schema is backward-compatible with minor Laravel versions.AuthCheckerMiddleware to intercept requests, which can be applied globally or per-route/group (e.g., /admin).AuthChecker\Events\Lockout, AuthChecker\Events\DeviceRegistered) for reactive logic (e.g., sending alerts via Laravel Notifications).max_attempts, lockout_duration). Misconfiguration could lead to legitimate users being blocked or intruders slipping through. Mitigation: Start with conservative defaults (e.g., max_attempts=5, lockout_duration=15m) and monitor via auth_checker_attempts table.queue facade to defer logging (e.g., AuthChecker::logAttempt($credentials, $result) in a job).device_id generation. Mitigation: Override AuthChecker::getDeviceId() if needed.composer.json constraints or use a compatibility layer.throttle) before lockouts? The package doesn’t replace Laravel’s built-in throttling; design may need both.AuthManager and Request.device_id).AuthChecker::logAttempt($credentials, $result, true).bcmath not required).Auth::attempt(), Auth::login(), or middleware runs.users, sessions) before adding new schema.composer require lab404/laravel-auth-checker
php artisan vendor:publish --provider="Lab404\AuthChecker\AuthCheckerServiceProvider"
php artisan migrate
.env for lockout thresholds (e.g., AUTH_CHECKER_MAX_ATTEMPTS=5).app/Http/Kernel.php:
protected $middlewareGroups = [
'web' => [
\Lab404\AuthChecker\Http\Middleware\AuthCheckerMiddleware::class,
// ... other middleware
],
];
AuthCheckerEvents for custom logic (e.g., log to a SIEM):
AuthChecker::addListener('lockout', function ($user, $device) {
event(new CustomLockoutEvent($user, $device));
});
AuthChecker::setDeviceResolver(function ($request) {
return 'api_client_' . $request->ip();
});
v1.0.0 (last compatible release).device_id generation works with token-based requests.AuthChecker::clearCache() for testing.AUTH_CHECKER_ENABLE_LOCKOUT=false).auth_checker_attempts matches expectations.auth_checker_lockouts table.auth_checker_attempts for anomalies (e.g., sudden spikes).lockout_duration).auth_checker_attempts table growth (archive old data if needed)..env and config/auth-checker.php. Use Laravel’s config caching for performance.v2.0.0 (if released).auth_checker_lockouts for affected users/devices.auth_checker_attempts for failed attempts.request()->ip() carefully), session conflicts (ensure device_id is stable).failed_attempts rate per user/device.lockout events (alert on spikes).device_registration (new devices may indicate compromise).tightenco/laravel-prometheus), or custom queries.AuthChecker::logAttempt).failed_at and user_id are indexed in auth_checker_attempts.auth_checker_lockouts table).How can I help you explore Laravel packages today?