<?php

namespace App\Http\Controllers;

use App\Http\Requests\AccessRequestsRequest;
use App\Models\AccessRequests;

class AccessRequestsController extends Controller
{
    public function index()
    {
        return AccessRequests::all();
    }

    public function store(AccessRequestsRequest $request)
    {
        return AccessRequests::create($request->validated());
    }

    public function show(AccessRequests $accessRequests)
    {
        return $accessRequests;
    }

    public function update(AccessRequestsRequest $request, AccessRequests $accessRequests)
    {
        $accessRequests->update($request->validated());

        return $accessRequests;
    }

    public function destroy(AccessRequests $accessRequests)
    {
        $accessRequests->delete();

        return response()->json();
    }
}
