Ancestors

Written by Jan Boddez on 2025-01-14 at 20:07

Once more experimenting with likes and reposts and how they’re displayed.

A facepile on hover would be kinda cool, I guess, but this’ll have to do for now.

(#Laravel makes this so easy.)

=> View attached media

=> More informations about this toot | More toots from janboddez@indieweb.social

Written by Jan Boddez on 2025-01-14 at 20:11

My IndieBlocks plugin for WordPress had (or, well, still has) a block pattern or something that unlocks this type of display, rather than the default “facepile.” Come to think of it, that version could be unreleased, still.

Either way, in my Laravel app’s Entry model, I simply have:

public function likes(): HasMany
{
    return $this->hasMany(Comment::class)
        ->where('type', 'like');
}

And so on. In other words, likes are just comments, with a type of like.

=> More informations about this toot | More toots from janboddez@indieweb.social

Written by Jan Boddez on 2025-01-14 at 20:12

And then I can loop over them like I do for “regular” comments, or simply, like in the screenshot above, do something like {{ $entry->likes->count() }}.

=> More informations about this toot | More toots from janboddez@indieweb.social

Toot

Written by Jan Boddez on 2025-01-14 at 20:20

Still have to fix how nested comments are displayed ... Tomorrow.

=> More informations about this toot | More toots from janboddez@indieweb.social

Descendants

Written by Jan Boddez on 2025-01-14 at 20:23

And a gazillion other things that nobody in this whole wide world cares about.

But, hey, if you wanted, purely hypothetically, you could totes self-host this and develop your own “theme” only, in simple PHP/Blade, and keep everything else as is, and it should “just work.”

=> More informations about this toot | More toots from janboddez@indieweb.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113828564528358521
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
263.338138 milliseconds
Gemini-to-HTML Time
0.967608 milliseconds

This content has been proxied by September (3851b).