@extends('layouts.admin') @section('content') @php $adminArtefactImageUrl = 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

Artefacts

Manage artefacts records from the database.

New Artefact
@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
Please check the highlighted fields and try again.
@endif
@forelse ($records as $record) @php $imageUrl = $adminArtefactImageUrl($record->image); $imageAlt = $record->image?->alt_text_en ?: $record->image?->title_en ?: $record->title_en; $titleEn = $record->title_en ?: '-'; $titleAs = $record->title_as ?: $titleEn; $statusEn = str($record->status ?? '-')->replace('_', ' ')->title()->toString(); $statusAs = $selectOptionLabelsAs[$record->status ?? ''] ?? $statusEn; @endphp
@if ($imageUrl) {{ $imageAlt }} @else @endif

{{ str($titleEn)->limit(80) }}

{{ $statusEn }}
Period {{ str($record->period ?? '-')->limit(60) }} Sort {{ $record->sort_order ?? '-' }}
@csrf @method('DELETE')
@empty
No artefacts found.
@endforelse
{{ $records->links() }}
@endsection