<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\ServiceRequest;

class ServiceRequestController extends Controller
{
    public function index()
    {
        $requests = ServiceRequest::with(['customer', 'vendor', 'providerService'])->latest()->paginate(15);
        return view('admin.service_requests.index', compact('requests'));
    }

    public function show($id)
    {
        $service_request = ServiceRequest::with(['customer', 'vendor', 'providerService'])->findOrFail($id);
        return view('admin.service_requests.show', compact('service_request'));
    }
}
