<?php

// app/Http/Controllers/PaymentsController.php
namespace App\Http\Controllers;

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

class PaymentsController extends Controller
{
    // GET /payments/{school} (read-only)
    public function index(Request $request)
    {
        $school = $request->user()->username;

        return Payment::where('sch_code', $school)
            ->orderByDesc('p_date')
            ->get();
    }

}


