paginate mods

This commit is contained in:
IsWaffle 2024-09-11 09:25:02 -04:00
parent 90aeecc6d8
commit f443364721
2 changed files with 10 additions and 2 deletions

View File

@ -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) {

View File

@ -108,8 +108,11 @@
<p class="m-4">This is the wall. I don't think this can be implemented yet? requires comments or something</p>
@break
@case('mods')
<div class="m-4">
{{ $mods->links() }}
</div>
<div class="m-4 grid grid-cols-1 gap-6 lg:grid-cols-2">
@foreach($user->mods as $mod)
@foreach($mods as $mod)
<x-mod-card :mod="$mod"/>
@endforeach
</div>