@extends('layouts.app') @section('title', 'Posts Management') @push('styles') @endpush @section('breadcrumb') Dashboard Posts @endsection @section('content')
all
Total posts
{{ $stats['total'] }}
OPEN
Active
{{ $stats['active'] }}
drafts
Draft
{{ $stats['draft'] }}
{{ $stats['closed'] }}
Closed
{{ $stats['closed'] }}
@php $livePosts = $posts->filter(fn ($p) => $p->isExamLive()); $scheduledPosts = $posts->filter(fn ($p) => $p->isExamPending()); $hasLive = $livePosts->isNotEmpty(); $hasScheduled = $scheduledPosts->isNotEmpty(); @endphp
@if($hasLive || $hasScheduled) @else @endif

@if($hasLive) Exam live now for {{ $livePosts->count() }} post(s) @elseif($hasScheduled) {{ $scheduledPosts->count() }} exam(s) scheduled @else No exams scheduled @endif

@if($hasLive) Approved candidates can sign in at /exam-portal/login using their roll number and exam password. @foreach($livePosts as $p) {{ $p->code }} @endforeach @elseif($hasScheduled) Candidates will be able to sign in once the scheduled time is reached. @foreach($scheduledPosts as $p) {{ $p->code }} · {{ $p->exam_login_enabled_at->format('d M, h:i A') }} @endforeach @else Click the Exam schedule cell on a row below to set the date and time for that post's exam. @endif

All posts
{{ $posts->count() }} record(s)
@if($posts->isEmpty())
No posts yet
Create your first recruitment post to get started.
Create a post
@else
@foreach($posts as $post) @php $status = strtolower($post->status_label ?? $post->status ?? ''); $pillTone = str_contains($status, 'active') ? 's-success' : (str_contains($status, 'draft') ? 's-warning' : (str_contains($status, 'clos') ? 's-danger' : 's-neutral')); @endphp @endforeach
# Code Title BPS Seats Quotas Status Exam schedule Created Actions
{{ $loop->iteration }} {{ $post->code }}
{{ $post->title }}
{{ Str::limit($post->qualification, 50) }}
{{ $post->bps }} {{ number_format($post->total_seats) }} {{ $post->quotas_count }} {{ $post->status_label ?? ucfirst($post->status) }} @php $examStatus = $post->exam_status; // 'live' | 'scheduled' | 'closed' $examTone = match ($examStatus) { 'live' => 's-success', 'scheduled' => 's-warning', default => 's-neutral', }; $examLabel = match ($examStatus) { 'live' => 'Live now', 'scheduled' => $post->exam_login_enabled_at?->format('d M, h:i A') ?? 'Scheduled', default => 'Not scheduled', }; @endphp {{ $post->created_at->format('d M Y') }}
@csrf @method('DELETE')
{{-- ── Per-post "Schedule exam" modals ──────────────────────────── --}} @foreach($posts as $post) @php $minDt = now()->format('Y-m-d\TH:i'); $curDt = $post->exam_login_enabled_at?->format('Y-m-d\TH:i'); @endphp @endforeach @endif
@endsection @push('scripts') @endpush