<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Koleksi;
use App\Models\BorrowTransaction;

class UserController extends Controller
{
    public function index()
    {
        return view('user.dashboard');
    }

    public function koleksi()
    {
        $books = Koleksi::all(); 
        return view('user.koleksi', compact('books'));
    }

    public function pinjaman()
    {
        $transactions = BorrowTransaction::where('user_id', auth()->id())->get();
        return view('user.pinjaman', compact('transactions'));
    }

    public function anggota()
    {
        return view('user.anggota');
    }
}

