add notifications logic and add support of both JWT and Sanctum

This commit is contained in:
root
2026-03-11 01:20:31 -04:00
parent f6be51576c
commit 182036cc41
141 changed files with 8685 additions and 648 deletions
@@ -0,0 +1,27 @@
<?php
namespace Tests\Unit\Services\Auth;
use App\Services\Auth\PasswordResetCleanupService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class PasswordResetCleanupServiceTest extends TestCase
{
use RefreshDatabase;
public function test_cleanup_removes_old_requests(): void
{
DB::table('password_reset_requests')->insert([
['ip_address' => '127.0.0.1', 'requested_at' => now()->subDays(40)],
['ip_address' => '127.0.0.1', 'requested_at' => now()->subDays(5)],
]);
$service = new PasswordResetCleanupService();
$deleted = $service->cleanup(30);
$this->assertSame(1, $deleted);
$this->assertDatabaseCount('password_reset_requests', 1);
}
}