@extends('layouts.admin') @section('title', 'Market rates') @section('actions')
@csrf
@endsection @section('content') @if ($keyMissing)
Set DATA_GOV_API_KEY in .env to load prices.
@endif
Showing prices for
{{ $date ? \Illuminate\Support\Carbon::parse($date)->format('d M Y') : '—' }}
Latest in database: {{ $latest ? \Illuminate\Support\Carbon::parse($latest)->format('d M Y') : 'none' }}
Last sync
@if ($last)
{{ ist($last['ran_at']) }} · fetched {{ $last['fetched'] }}, saved {{ $last['saved'] }}, new markets {{ $last['markets_created'] }}
@else
Never run from this panel. It also runs automatically at 8 am and 6 pm IST when the Laravel scheduler is on.
@endif
Source: Agmarknet via data.gov.in · prices are ₹ per quintal.
@if ($last && $last['unmatched'])
{{ count($last['unmatched']) }} commodities in the feed have no crop

Their prices are skipped until the crop exists. Add the ones farmers trade; the rest can stay out.

@foreach ($last['unmatched'] as $name => $n)
@csrf
{{ $name }}
{{ $n }} prices
@can('settings.manage') @endcan
@endforeach
@endif
@forelse ($prices as $p) @empty @endforelse
CropVariety / gradeMarketDistrictMin ₹Modal ₹Max ₹
{{ $p->crop }} {{ trim($p->variety_label.' '.($p->grade_label && $p->grade_label !== $p->variety_label ? '· '.$p->grade_label : '')) ?: '—' }} {{ $p->market }} {{ $p->district ?? '—' }} {{ indian_number($p->min_price) }} {{ indian_number($p->modal_price) }} {{ indian_number($p->max_price) }}
No prices for this date. Press “Sync now”.
{{ $prices->links() }}
@endsection