diff --git a/app/Livewire/User/Profile.php b/app/Livewire/User/Profile.php index 82c4675..f6336db 100644 --- a/app/Livewire/User/Profile.php +++ b/app/Livewire/User/Profile.php @@ -27,12 +27,13 @@ class Profile extends Component $this->followers = $this->user->followers; $this->following = $this->user->following; - $mods = $this->user->mods()->paginate(6); + $mods = $this->user->mods()->withWhereHas('latestVersion')->paginate(6); return view('livewire.user.profile', compact('mods')); } - public function setSection(string $name) { + public function setSection(string $name) + { $this->section = $name; } diff --git a/app/Livewire/UserStack.php b/app/Livewire/UserStack.php index 050ba81..874fff1 100644 --- a/app/Livewire/UserStack.php +++ b/app/Livewire/UserStack.php @@ -4,7 +4,6 @@ namespace App\Livewire; use App\Models\User; use Illuminate\Support\Facades\Auth; -use Illuminate\Support\Facades\Log; use Livewire\Attributes\Reactive; use Livewire\Component; @@ -41,8 +40,7 @@ class UserStack extends Component public function closeDialog() { - if ($this->refreshNeeded) - { + if ($this->refreshNeeded) { $this->dispatch('refreshNeeded'); } diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 770667b..c4bfe9a 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -16,6 +16,7 @@ class UserFactory extends Factory /** * Define the user's default state. + * * @throws RandomException */ public function definition(): array diff --git a/resources/views/livewire/user/profile.blade.php b/resources/views/livewire/user/profile.blade.php index 8d856f8..115cc6d 100644 --- a/resources/views/livewire/user/profile.blade.php +++ b/resources/views/livewire/user/profile.blade.php @@ -113,7 +113,7 @@
@foreach($mods as $mod) - + @endforeach
@break diff --git a/tests/Feature/User/FollowTest.php b/tests/Feature/User/FollowTest.php index c983d00..d86275c 100644 --- a/tests/Feature/User/FollowTest.php +++ b/tests/Feature/User/FollowTest.php @@ -31,7 +31,6 @@ test('confirm following a user cannot be done twice', function () { $user1->follow($user2); $user1->follow($user2); - $this->assertCount(1, $user1->following); $this->assertCount(1, $user2->followers); });