@extends('layouts.app') @section('title', 'Harvest Management - Blackberry Farm') @section('content')

🫐 Harvest Management

Track and analyze berry harvests with quality metrics

📊 Record New Harvest 🫐 Bulk Field Harvest ← Back to Plants
@if($stats)
{{ number_format($stats->total_harvests ?? 0) }}
Total Harvests
{{ number_format($stats->total_quantity ?? 0, 1) }} lbs
Total Quantity
{{ $stats->avg_brix ? number_format($stats->avg_brix, 1) : 'N/A' }}
Avg Brix Level
{{ $stats->latest_harvest ? date('M j', strtotime($stats->latest_harvest)) : 'None' }}
Latest Harvest
@endif

📊 Harvest Yield Analytics

📈 Monthly Harvest Trends

🌟 Quality Distribution

🫐 Top Performing Varieties

@if(isset($harvests) && $harvests->count() > 0) @php $varietyYields = $harvests->groupBy('variety_name')->map(function($group) { return [ 'total_quantity' => $group->sum('quantity_lbs'), 'avg_brix' => $group->avg('brix_level'), 'harvest_count' => $group->count() ]; })->sortByDesc('total_quantity'); @endphp @foreach($varietyYields->take(5) as $varietyName => $data)
{{ $varietyName ?: 'Unknown Variety' }}
{{ $data['harvest_count'] }} harvests
{{ number_format($data['total_quantity'], 1) }} lbs
Avg Brix: {{ $data['avg_brix'] ? number_format($data['avg_brix'], 1) : 'N/A' }}
@endforeach @else
No harvest data available yet. Start recording harvests to see analytics.
@endif
@if (session('success'))
Success! {{ session('success') }}
@endif @if($harvests->count() > 0) @foreach($harvests as $harvest) @endforeach
Harvest Date Plant Variety Yield Quality Destination Season Harvester Actions
{{ date('M j, Y', strtotime($harvest->harvest_date)) }} {{ $harvest->plant_id }} @if($harvest->plant_location)
{{ $harvest->plant_location }} @endif
{{ $harvest->variety_name ?? 'Unknown' }} {{ number_format($harvest->yield_lbs, 2) }} lbs {{ str_replace('_', ' ', ucwords($harvest->berry_quality_grade, '_')) }} @if($harvest->average_sweetness_brix)
({{ number_format($harvest->average_sweetness_brix, 1) }} Brix) @endif
{{ str_replace('_', ' ', ucwords($harvest->market_destination, '_')) }} {{ ucfirst($harvest->season) }} {{ $harvest->harvested_by ?? 'Unknown' }} View Edit
@if($harvests->hasPages()) @endif @else

No Harvests Recorded Yet

Start tracking your berry harvests to analyze production and quality metrics.

📊 Record First Harvest
@endif
@endsection @push('scripts') @endpush