Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Gummibeer/gummibeer.de

11 stars
3 code files
View Gummibeer/gummibeer.de on GitHub

app/View/Components/Avatar.php

Open in GitHub
use Astrotomic\Unavatar\Laravel\Unavatar;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
 
class Avatar extends Component
{
public string $search;
public ?string $src = null;
public ?string $provider = null;
 
public function __construct(string $search, ?string $src = null, ?string $provider = null)
{
$this->search = $search;
$this->src = $src;
$this->provider = $provider;
}
 
public function render(): View
{
return view('components.avatar');
}
 
public function url(): string
{
if ($this->src) {
return $this->src;
}
 
return Unavatar::make($this->search, $this->provider)->toUrl();
}
}

resources/views/components/avatar.blade.php

Open in GitHub
<x-img :src="$url()" {{ $attributes->merge(['ratio' => '1:1', 'class' => 'inline-block rounded-full min-w-full min-h-full object-cover']) }} />

resources/views/components/post/webmentions.blade.php

Open in GitHub
@if($likes->isNotEmpty())
<footer {{ $attributes->merge(['class' => 'space-y-12']) }}>
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2">
@if($likes->isNotEmpty())
<div class="flex items-center space-x-3">
<ul class="flex overflow-hidden -space-x-2">
@foreach($likes->take(6) as $like)
<li class="block w-8 h-8">
<x-avatar
:search="parse_url($like->url, PHP_URL_HOST)"
:src="$like->author->avatar"
width="64"
height="64"
class="border-2 border-solid border-snow-0 dark:border-night-0"
:alt="$like->author->name"
:title="$like->author->name"
/>
</li>
@endforeach
</ul>
</div>
@endif
//
</footer>
@endif

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.