From f4433647217bc63f678b3550ed964628d007d6f1 Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Wed, 11 Sep 2024 09:25:02 -0400 Subject: [PATCH] paginate mods --- app/Livewire/User/Profile.php | 7 ++++++- resources/views/livewire/user/profile.blade.php | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Livewire/User/Profile.php b/app/Livewire/User/Profile.php index 96cf616..82c4675 100644 --- a/app/Livewire/User/Profile.php +++ b/app/Livewire/User/Profile.php @@ -5,9 +5,12 @@ namespace App\Livewire\User; use App\Models\User; use Livewire\Attributes\Url; use Livewire\Component; +use Livewire\WithPagination; class Profile extends Component { + use WithPagination; + public User $user; #[Url] @@ -24,7 +27,9 @@ class Profile extends Component $this->followers = $this->user->followers; $this->following = $this->user->following; - return view('livewire.user.profile'); + $mods = $this->user->mods()->paginate(6); + + return view('livewire.user.profile', compact('mods')); } public function setSection(string $name) { diff --git a/resources/views/livewire/user/profile.blade.php b/resources/views/livewire/user/profile.blade.php index 6faed79..8d856f8 100644 --- a/resources/views/livewire/user/profile.blade.php +++ b/resources/views/livewire/user/profile.blade.php @@ -108,8 +108,11 @@

This is the wall. I don't think this can be implemented yet? requires comments or something

@break @case('mods') +
+ {{ $mods->links() }} +
- @foreach($user->mods as $mod) + @foreach($mods as $mod) @endforeach