10-04-2026

This commit is contained in:
Kevin Adametz 2026-04-10 17:18:17 +02:00
parent 4d6b4930b2
commit 4bb89aad8c
836 changed files with 52961 additions and 5950 deletions

View file

@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace App\View\Components;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class WebPicture extends Component
{
public string $webpSrc;
public bool $hasWebp;
public function __construct(
public string $src,
public string $alt = '',
public string $class = '',
public string $loading = 'lazy',
public string $width = '',
public string $height = '',
) {
$this->webpSrc = preg_replace('/\.(jpe?g|png)$/i', '.webp', $this->src);
$this->hasWebp = file_exists(public_path(
str_replace(asset(''), '', $this->webpSrc)
));
}
public function render(): View
{
return view('components.web-picture');
}
}