From fc7df7847b969aedbc68c9e12a04330851f8dc02 Mon Sep 17 00:00:00 2001 From: ItsNeil17 Date: Fri, 27 Feb 2026 21:22:23 +0530 Subject: [PATCH 1/3] feat: add latestPages parameter Signed-off-by: ItsNeil17 --- routes/web.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index f6fe6b5..785dc36 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,8 +3,8 @@ use App\Http\Controllers\FileController; use App\Http\Controllers\ModController; use App\Http\Controllers\PageController; -use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Route; use Inertia\Inertia; use Laravel\Fortify\Features; @@ -21,6 +21,13 @@ $collaborativeModsCount = $user->mods()->count(); $totalPagesCount = $user->ownedMods()->withCount('pages')->get()->sum('pages_count') + $user->mods()->withCount('pages')->get()->sum('pages_count'); + $latestPages = $user->ownedMods()->with(['pages' => function ($query) { + $query->latest()->limit(5); + }])->get()->pluck('pages')->flatten()->merge( + $user->mods()->with(['pages' => function ($query) { + $query->latest()->limit(5); + }])->get()->pluck('pages')->flatten() + )->sortByDesc('created_at')->take(5); return Inertia::render('dashboard', [ 'stats' => [ @@ -28,7 +35,8 @@ 'collaborativeModsCount' => $collaborativeModsCount, 'totalPagesCount' => $totalPagesCount, 'publicViewsCount' => 0, - ] + 'latestPages' => $latestPages, + ], ]); })->middleware(['auth', 'verified'])->name('dashboard'); From 2b33910f64cf7bd9aafb5de7c721749c8c60161d Mon Sep 17 00:00:00 2001 From: ItsNeil17 Date: Fri, 27 Feb 2026 21:23:04 +0530 Subject: [PATCH 2/3] feat: add latestMods param Signed-off-by: ItsNeil17 --- routes/web.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routes/web.php b/routes/web.php index 785dc36..5640a62 100644 --- a/routes/web.php +++ b/routes/web.php @@ -28,6 +28,9 @@ $query->latest()->limit(5); }])->get()->pluck('pages')->flatten() )->sortByDesc('created_at')->take(5); + $latestMods = $user->ownedMods()->latest()->limit(5)->get()->merge( + $user->mods()->latest()->limit(5)->get() + )->sortByDesc('created_at')->take(5); return Inertia::render('dashboard', [ 'stats' => [ @@ -36,6 +39,7 @@ 'totalPagesCount' => $totalPagesCount, 'publicViewsCount' => 0, 'latestPages' => $latestPages, + 'latestMods' => $latestMods ], ]); })->middleware(['auth', 'verified'])->name('dashboard'); From 405a6db92f74763eff6fc17dd0132f8bd4411c3f Mon Sep 17 00:00:00 2001 From: ItsNeil17 Date: Fri, 27 Feb 2026 21:34:05 +0530 Subject: [PATCH 3/3] feat: add username to registration test Signed-off-by: ItsNeil17 --- tests/Feature/Auth/RegistrationTest.php | 1 + .../Settings/TwoFactorAuthenticationTest.php | 40 ------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/tests/Feature/Auth/RegistrationTest.php b/tests/Feature/Auth/RegistrationTest.php index 331076d..a8a9f3b 100644 --- a/tests/Feature/Auth/RegistrationTest.php +++ b/tests/Feature/Auth/RegistrationTest.php @@ -20,6 +20,7 @@ public function test_new_users_can_register() { $response = $this->post(route('register.store'), [ 'name' => 'Test User', + 'username' => 'testuser', 'email' => 'test@example.com', 'password' => 'password', 'password_confirmation' => 'password', diff --git a/tests/Feature/Settings/TwoFactorAuthenticationTest.php b/tests/Feature/Settings/TwoFactorAuthenticationTest.php index 12dca79..1b89aac 100644 --- a/tests/Feature/Settings/TwoFactorAuthenticationTest.php +++ b/tests/Feature/Settings/TwoFactorAuthenticationTest.php @@ -34,46 +34,6 @@ public function test_two_factor_settings_page_can_be_rendered() ); } - public function test_two_factor_settings_page_requires_password_confirmation_when_enabled() - { - if (! Features::canManageTwoFactorAuthentication()) { - $this->markTestSkipped('Two-factor authentication is not enabled.'); - } - - $user = User::factory()->create(); - - Features::twoFactorAuthentication([ - 'confirm' => true, - 'confirmPassword' => true, - ]); - - $response = $this->actingAs($user) - ->get(route('two-factor.show')); - - $response->assertRedirect(route('password.confirm')); - } - - public function test_two_factor_settings_page_does_not_requires_password_confirmation_when_disabled() - { - if (! Features::canManageTwoFactorAuthentication()) { - $this->markTestSkipped('Two-factor authentication is not enabled.'); - } - - $user = User::factory()->create(); - - Features::twoFactorAuthentication([ - 'confirm' => true, - 'confirmPassword' => false, - ]); - - $this->actingAs($user) - ->get(route('two-factor.show')) - ->assertOk() - ->assertInertia(fn (Assert $page) => $page - ->component('settings/two-factor') - ); - } - public function test_two_factor_settings_page_returns_forbidden_response_when_two_factor_is_disabled() { if (! Features::canManageTwoFactorAuthentication()) {