<?php

namespace App\Http\Controllers;

use Illuminate\Http\JsonResponse;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    protected function wrapResource(JsonResource $resource, int $status = 200): JsonResponse
    {
        return response()->json([
            'data' => $resource->resolve(request()),
        ], $status);
    }
}
