Files
ladill-frontdesk/app/Providers/AppServiceProvider.php
T
isaaccladandCursor 9e2d79936c
Deploy Ladill Frontdesk / deploy (push) Failing after 35s
Test / test (push) Failing after 2m45s
Initial Ladill Frontdesk release with deploy pipeline.
Visitor management app with SSO, kiosk, badges, reports, and Gitea CI deploy to frontdesk.ladill.com.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 20:37:15 +00:00

34 lines
927 B
PHP

<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
//
}
public function boot(): void
{
RateLimiter::for('kiosk-device', function (Request $request) {
$key = $request->route('token')
?? $request->header('X-Device-Token')
?? $request->ip();
return Limit::perMinute(30)->by((string) $key);
});
RateLimiter::for('qr-scan', fn (Request $request) => Limit::perMinute(20)->by($request->ip()));
RateLimiter::for('device-heartbeat', function (Request $request) {
return Limit::perMinute(60)->by((string) ($request->header('X-Device-Token') ?? $request->ip()));
});
}
}