@extends('layouts.app') @php $pageTitle = $decision['title'] ?? 'Decision Details'; $rawText = $decision['details']['metadata']['hidden_indexable_content'] ?? ($decision['description'] ?? ''); $cleanText = trim(preg_replace('/\s+/', ' ', strip_tags($rawText))); $extract = \Illuminate\Support\Str::limit($cleanText, 120); $metaDescription = "Employment Tribunal Decision - " . $extract; @endphp @section('title', $pageTitle) @section('meta_description', $metaDescription) @if (!empty($isNoIndex)) @section('meta_robots', 'noindex, nofollow') @endif @section('content')
Back to Search

{{ $decision['title'] ?? 'Decision Details' }}

@if(isset($decision['document_type'])) @php $formatLabels = [ 'employment_tribunal_decision' => 'Employment Tribunal', 'employment_appeal_tribunal_decision' => 'Employment Appeal Tribunal', 'utaac_decision' => 'Administrative Appeals (UTAAC)', 'residential_property_tribunal_decision' => 'Residential Property Tribunal', ]; $label = $formatLabels[$decision['document_type']] ?? 'Decision'; @endphp
{{ $label }}
@endif

@php $publishedDate = $decision['public_updated_at'] ?? $decision['first_published_at'] ?? null; @endphp Published on {{ $publishedDate ? \Carbon\Carbon::parse($publishedDate)->format('d F Y, H:i') : 'Unknown' }}

Summary
{{ $decision['description'] ?? 'No summary available.' }}
@if(isset($decision['details']['metadata'])) @foreach($decision['details']['metadata'] as $key => $value) @if($key === 'hidden_indexable_content') @continue @endif
{{ str_replace('_', ' ', str_replace('tribunal_decision_', '', $key)) }}
@if(is_array($value))
@foreach($value as $item) @php $label = is_array($item) && isset($item['label']) ? $item['label'] : (is_array($item) ? implode(', ', $item) : $item); @endphp {{ $label }} @endforeach
@else {{ $value }} @endif
@endforeach @endif
@if(count($attachments) > 0)

Official Documents

    @foreach($attachments as $attachment)
  • {{ $attachment['title'] ?? 'Document' }}
  • @endforeach
@endif @php $bodyHtml = $decision['details']['body'] ?? ''; // Smart Hiding Logic: Check if body is just boilerplate $strippedBody = trim(strip_tags($bodyHtml)); $cleanText = str_replace(['Read the full decision in', '.', ','], '', $strippedBody); $cleanText = preg_replace('/\s+/', '', $cleanText); foreach($attachments as $attachment) { $cleanTitle = preg_replace('/\s+/', '', $attachment['title'] ?? ''); if (!empty($cleanTitle)) { $cleanText = str_replace($cleanTitle, '', $cleanText); } } $showDecisionContent = !empty($bodyHtml) && strlen($cleanText) > 20; if (count($attachments) === 0 && !empty($bodyHtml)) { $showDecisionContent = true; } @endphp @if($showDecisionContent)

Decision Content

@php $bodyHtml = str_replace('href="/', 'href="https://www.gov.uk/', $bodyHtml); $bodyHtml = preg_replace_callback('/]*>(.*?)<\/a>/i', function($matches) { $url = $matches[1]; $title = strip_tags($matches[2]); $svg = ''; return '' . $svg . '' . $title . 'Download'; }, $bodyHtml); @endphp {!! $bodyHtml !!}
@endif
@if(!empty($decision['details']['change_history']))

Change History

    @foreach($decision['details']['change_history'] as $index => $history)
  • @if(!$loop->last) @endif

    {{ $history['note'] ?? 'Updated' }}

  • @endforeach
@endif
@if(!empty($decision['details']['metadata']['hidden_indexable_content']))

Full Decision Text

Raw text extracted from the official documents.

{{ $decision['details']['metadata']['hidden_indexable_content'] }}
@endif @php $entities = []; $rawTitle = $decision['title'] ?? ''; if (!empty($rawTitle)) { // Strip case number (anything from the last colon onwards) $cleanTitle = preg_replace('/:\s*.*/', '', $rawTitle); // Split by ' v ' $parts = preg_split('/\s+v\.?\s+/i', $cleanTitle); foreach ($parts as $part) { // Split by ' and ', commas, 'trading as', or 't/a' $subparts = preg_split('/(?:\s+and\s+|,|\s+trading\s+as\s+|\s+t\/a\s+)/i', $part); foreach ($subparts as $subpart) { $clean = trim($subpart); // Drop 'Others' and empty strings if (strcasecmp($clean, 'others') !== 0 && !empty($clean)) { // Strip leading numbers like "1. " or "2. " $clean = preg_replace('/^\d+\.\s*/', '', $clean); $entities[] = $clean; } } } } @endphp @if(count($entities) > 0)

Related Parties

Search the database for other cases involving these individuals or companies.

@foreach($entities as $entity) {{ $entity }} @endforeach
@endif @endsection