This commit is contained in:
Dr Masroor Ehsan 2025-01-10 18:56:27 +06:00
parent 34b0d1f84f
commit 34638604c1
4 changed files with 4 additions and 3 deletions

View File

@ -26,7 +26,7 @@ class Study extends BaseModel implements HasMedia
use InteractsWithMedia;
public const string MEDIA_COLLECTION = 'attachments';
public const string FALLBACK_IMAGE = 'imgs/pdf.png';
public const string FALLBACK_IMAGE = 'imgs/doc-pdf.png';
public function details(): HasOne
{

View File

@ -1,5 +1,6 @@
<?php
use App\Models\Study;
use App\Models\User;
use App\Services\AuditTrail\ActivityLogger;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
@ -105,10 +106,10 @@ function chomp(string $s, int $len, int $right = 6): string
function thumb_url(Media $media): string
{
if ($media->mime_type === 'application/pdf') {
return asset('imgs/pdf.png');
return asset(Study::FALLBACK_IMAGE);
}
return $media->getUrl('tn') ?? asset('imgs/pdf.png');
return $media->getUrl('tn') ?? asset(Study::FALLBACK_IMAGE);
}
}

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB