<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Lapor;
use Illuminate\Support\Facades\Auth;

class PetaniController extends Controller
{
    public function dashboard()
{
    $laporan = \App\Models\Lapor::where('user_id', auth()->id())->get();

    $total = $laporan->count();
    $diproses = $laporan->where('status','diproses')->count();
    $selesai = $laporan->where('status','selesai')->count();

    return view('petani.dashboard', compact(
        'laporan',
        'total',
        'diproses',
        'selesai'
    ));
}
}