{{-- Flash Messages --}} @if (session()->has('message')) @endif @if (session()->has('error')) @endif {{-- ── Top Action Bar ───────────────────────────────────────────── --}}
{{-- Add More --}} @if(($role_id == 1) || in_array(23, $permissions)) @if(!$formMode && !$viewMode) @endif @endif {{-- My Drafts Toggle Button --}} @php $draftCount = \App\Models\CryptoNewsDraft::count(); @endphp @if($draftCount > 0) @endif Import JSON
{{-- ══════════════════════════════════════════════════════════════ --}} {{-- ── DRAFT PANEL (slide toggle, no delete) ──────────────────── --}} {{-- ══════════════════════════════════════════════════════════════ --}} @php $allDrafts = \App\Models\CryptoNewsDraft::latest() ->get(); @endphp @if($allDrafts->isNotEmpty()) @endif {{-- ── END DRAFT PANEL ─────────────────────────────────────────── --}} {{-- ── Form Section ─────────────────────────────────────────────── --}} @if($formMode)
{{ $updateMode ? 'Edit News' : 'Add News' }}
{{-- ── Draft Status Bar (create mode only) ──────────────── --}} @if(!$updateMode)
Saving draft... Draft saved at Auto-saves every 2 minutes @if($draftId) @endif
@endif {{-- ── End Draft Status Bar ─────────────────────────────── --}}
@include('livewire.admin.partials.crypto-news-form')
@endif {{-- ── View Section ─────────────────────────────────────────────── --}} @if($viewMode && $cryptoToView)
Crypto News Details
@include('livewire.admin.partials.crypto-news-view')
@endif {{-- ── News Table ───────────────────────────────────────────────── --}}
All News
@forelse ($cryptos as $index => $crypto) {{----}} @php $baseUrl = env('WEB_URL'); // Current time $now = \Carbon\Carbon::now(); // Published time $publishedAt = $crypto->published_at ? \Carbon\Carbon::parse($crypto->published_at) : null; // Preview condition $isPreview = ($crypto->is_seo_check == 0) || ($publishedAt && $publishedAt->gt($now)); $preview = $isPreview ? '?preview=draft' : ''; // Final URL $url = $baseUrl . '/' . $crypto->alias . $preview; @endphp @empty @endforelse
Image Title Author Uploaded At Published At News Type SEO Check Actions
{{ $cryptos->firstItem() + $index }} @if($crypto->image) {{ $crypto->img_alt_title }} @else No Image @endif {{ $crypto->postAuthor?->dispaly_name ?? ($crypto->author_name ?? "N/A") }} {{ $crypto->created_at ? $crypto->created_at->format('d M Y h:i A') : 'N/A' }} {{ $crypto->publishedAt ? date('d M Y h:i A', $crypto->publishedAt) : 'N/A' }} @switch($crypto->is_gabbar) @case(1) News @break @case(2) Press Release @break @case(3) Sponsored @break @case(4) Guest News @break @case(5) Blog @break @case(6) Crypto News @break @default Draft @endswitch @if($crypto->is_seo_check) Yes @else No @endif
@if(($role_id == 1) || in_array(24, $permissions)) @endif @if(($role_id == 1) || in_array(25, $permissions)) @endif @if(($role_id == 1) || in_array(27, $permissions)) @endif @if(($role_id == 1) || in_array(26, $permissions)) @endif
No records found
{{ $cryptos->links() }}