@php $trialTypes = ['on_farm' => 'On-farm', 'on_station' => 'On-station']; $formatDate = fn ($date) => $date ? \Illuminate\Support\Carbon::parse($date)->format('M j, Y') : '—'; $formatDates = fn ($dates) => $dates ? collect($dates)->map($formatDate)->implode(', ') : '—'; $formatSize = function ($bytes) { $units = ['B', 'KB', 'MB', 'GB']; $i = $bytes > 0 ? min((int) floor(log($bytes, 1024)), count($units) - 1) : 0; return round($bytes / (1024 ** $i), 2) . ' ' . $units[$i]; }; @endphp Trial submissions

Trial submissions

{{ $trials->count() }} {{ Str::plural('submission', $trials->count()) }} · Generated {{ $generatedAt->format('M j, Y H:i') }}
@if ($trials->isEmpty())

No trials have been submitted yet.

@else @foreach ($trials as $trial) @endforeach
# Title Type Crop Season / Year Submitted by Submitted
{{ $loop->iteration }} {{ $trial->title }} {{ $trialTypes[$trial->trial_type] ?? '—' }} {{ $trial->crop ?: '—' }} {{ trim($trial->trial_season . ' ' . $trial->trial_year) ?: '—' }} {{ $trial->user?->name ?? '—' }} {{ $formatDate($trial->created_at) }}
@foreach ($trials as $trial)

{{ $loop->iteration }}. {{ $trial->title }}

Submitted {{ $formatDate($trial->created_at) }} @if ($trial->user) by {{ $trial->user->name }} ({{ $trial->user->email }}) @endif
Description{{ $trial->description ?: '—' }}
Trial type{{ $trialTypes[$trial->trial_type] ?? '—' }}
Season{{ $trial->trial_season ?: '—' }}
Year{{ $trial->trial_year ?: '—' }}
Crop{{ $trial->crop ?: '—' }}
Varieties{{ $trial->varieties ?: '—' }}
Location{{ $trial->location ?: '—' }}
GPS coordinates{{ $trial->gps_coordinates ?: '—' }}
Treatments (factor A) @if ($trial->treatments)
    @foreach ($trial->treatments as $treatment)
  • {{ $treatment }}
  • @endforeach
@else — @endif
Treatments (factor B) @if ($trial->treatments_factor_b)
    @foreach ($trial->treatments_factor_b as $treatment)
  • {{ $treatment }}
  • @endforeach
@else — @endif
Replications{{ $trial->replication_no ?: '—' }}
Establishment dates{{ $formatDates($trial->establishment_dates) }}
Harvest dates{{ $formatDates($trial->harvest_dates) }}
Conducted by{{ $trial->conducted_by ?: '—' }}
Contact email{{ $trial->contact_email ?: '—' }}
Data files @if ($trial->files)
    @foreach ($trial->files as $file)
  • {{ $file['original_name'] }} ({{ $formatSize($file['file_size'] ?? 0) }})
  • @endforeach
@else — @endif
@endforeach @endif