radfusion/app/Services/Report/StampService.php
2025-01-12 13:17:35 +06:00

34 lines
791 B
PHP

<?php
namespace App\Services\Report;
use App\Models\User;
use Illuminate\Support\Facades\Storage;
final class StampService
{
private User $user;
public function __construct(User|int|null $user = null)
{
$this->user = me($user);
}
public function hasSignatureImage(): bool
{
$path = $this->user->radiologistProfile?->signature_image_path;
return $path !== null && Storage::disk('public')->exists($path);
}
public function signatureImagePath(): string
{
return Storage::disk('public')->path($this->user->radiologistProfile?->signature_image_path);
}
public function signatureImageUrl(): string
{
return Storage::disk('public')->url($this->user->radiologistProfile?->signature_image_path);
}
}