@extends('layouts.app') @section('content') {{-- Page Header --}} @php // Custom colors for badges $typeColors = [ 'Update' => '#0d6efd', // blue 'Message' => '#198754', // green 'Offer' => '#ffc107', // yellow 'Alert' => '#dc3545', // red 'Notice' => '#0dcaf0', // cyan 'News' => '#6c757d', // gray 'Other' => '#343a40', // dark ]; @endphp {{-- Announcements Table --}}

{{ __('Announcements') }} ({{ __('Latest') }})

@forelse($announcements as $announcement) @php $message = json_decode($announcement->message); $users = json_decode($announcement->user_ids) ?? []; $color = $typeColors[$message->type] ?? '#adb5bd'; // default gray @endphp {{-- Type Badge --}} {{-- Sent To Badge --}} {{-- Actions --}} @empty @endforelse
# {{ __('Title') }} {{ __('Message') }} {{ __('Type') }} {{ __('Sent To') }} {{ __('Actions') }}
{{ $loop->iteration }} {{ $message->title }} {{ \Illuminate\Support\Str::limit($message->body, 50) }} {{ $message->type }} {{ count($users) }} {{ __('Users') }}
{{ __('No announcements found.') }}
{{-- Pagination --}}
{{ $announcements->links() }}
@endsection