{{-- Flash Messages --}} @if (session()->has('message')) @endif
{{-- Add More --}} @if(($role_id == 1) || in_array(15, $permissions)) @if(!$formMode && !$viewMode) @endif {{-- My Drafts Toggle Button --}} @php $draftCount = \App\Models\CryptoNewsDraft::count(); @endphp @if($draftCount > 0) @endif @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 {{-- Table Section --}}
All News
{{-- Filters --}}
{{-- Table --}}
@forelse ($cryptos as $index => $crypto) {{----}} @php $baseUrl = env('WEB_URL'); $now = \Carbon\Carbon::now(); // ✅ FIXED FIELD NAME $publishedAt = $crypto->publishedAt ? \Carbon\Carbon::parse($crypto->publishedAt) : null; $isPreview = ($crypto->is_seo_check == 0) || ($publishedAt && $publishedAt->gt($now)); $preview = $isPreview ? '?preview=draft' : ''; $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->title }}
{{ $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(16, $permissions)) @endif @if(($role_id == 1) || in_array(17, $permissions)) @endif @if(($role_id == 1) || in_array(19, $permissions)) @endif @if(($role_id == 1) || in_array(18, $permissions)) @endif

No records found

{{-- Pagination --}}
{{ $cryptos->links() }}