thepanda's avatar

thepanda wrote a reply+100 XP

2mos ago

Thanks, it was a life saver.

thepanda's avatar

thepanda liked a comment+100 XP

2mos ago

Hey. I came up with an idea/solution. You can like it or hate it, but this is what I can give you :D

Using, livewire 3 and alpineJs/vanillaJs solutions.

The view:

x-user-tile (in views/components)

@props(['user', 'bg'])

<div wire:key="{{ $user->id }}"
     style="background: {{ $bg }};
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            color: #1f2937;">
    {{ $user->name }}
</div>

I'm using the laravel pagination, combined with livewire use WithPagination, WithoutUrlPagination; With this approach, I only append to the parent, preventing the growth of property, and querying the whole dataset using only the limit.

p.s. with livewire 4, there is/will be a solution for this: https://livewire.laravel.com/docs/4.x/islands#append-and-prepend-modes

thepanda's avatar

thepanda liked a comment+100 XP

3mos ago

thepanda's avatar

thepanda liked a comment+100 XP

3mos ago

@digiton Thanks! Working on Livewire is a dream job 😍