<?php

namespace App\Http\Controllers;

use App\Models\Creance;
use Illuminate\Http\Request;

class InvoiceController extends Controller
{
    /**
     * Liste des factures impayées
     */
    public function __invoke(Request $request)
    {
        $impaye = Creance::where('statut', 'impaye')
            ->sum('montant_restant')->latest()->paginate(10)->get();
    }
}
