<?php

namespace App\Http\Resources\System;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class DashboardRouteResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'route' => $this->resource['route'] ?? null,
            'role' => $this->resource['role'] ?? null,
            'role_slug' => $this->resource['role_slug'] ?? null,
            'roles' => $this->resource['roles'] ?? [],
        ];
    }
}
