@extends('layouts.admin')
@section('content')
@php
$adminMediaAssetUrl = static function ($asset) {
if (! $asset?->file_path) {
return null;
}
$path = $asset->file_path;
if (str($path)->startsWith(['http://', 'https://', '/'])) {
return $path;
}
if (str($path)->startsWith('storage/')) {
return asset($path);
}
if (str($path)->startsWith('images/')) {
return asset($path);
}
if (($asset->disk ?: 'public') === 'public') {
return asset('storage/'.$path);
}
return \Illuminate\Support\Facades\Storage::disk($asset->disk)->url($path);
};
@endphp
Admin Module Manage media assets records from the database.Media Assets
| Preview | Title | File Type | File Path | Status | Actions |
|---|---|---|---|---|---|
|
@php
$mediaUrl = $adminMediaAssetUrl($record);
@endphp
@if ($record->file_type === 'image' && $mediaUrl)
|
@php $valueEn = $record->title_en ?: '-'; $valueAs = $record->title_as ?: $valueEn; @endphp {{ str($valueEn)->limit(80) }} | {{ str($record->file_type ?? '-')->limit(80) }} | {{ str($record->file_path ?? '-')->limit(80) }} | @php $statusEn = str($record->status ?? '-')->replace('_', ' ')->title()->toString(); $statusAs = $selectOptionLabelsAs[$record->status ?? ''] ?? $statusEn; @endphp {{ $statusEn }} | |
| No media assets found. | |||||